Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Why can't I run the programs from the book OpenGL Superbible Third Edition?

  1. #1
    Newbie Newbie
    Join Date
    Aug 2012
    Posts
    2

    Why can't I run the programs from the book OpenGL Superbible Third Edition?

    Here is the program from the book OpenGL SuperBible, I have been stuck on it for the past week. I am compiling on a Mac OS X Lion with Xcode 4. I am using the OpenGL and GLUT libraries. Here is the runtime error I am receiving and the sample code. Thanks for all the help, sorry, I'm still a beginner.

    #include <OpenGL/gl.h>
    #include <GLUT/glut.h>

    void RenderScene(void)
    {
    glClear(GL_COLOR_BUFFER_BIT);

    glFlush();
    }

    void SetupRC(void)
    {
    glClearColor(0.0f, 0.0f, 1.0f, 1.0f);
    }

    int main(void)
    {
    glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
    glutCreateWindow("Simple");
    glutDisplayFunc(RenderScene);

    SetupRC();

    glutMainLoop();

    return (0);
    }

    //copied from OpenGL SUPERBBIBLE third edition
    //end of code

    here is the runtime error I get


    Aug 31 15:04:42 ****-pc.home OpenGL Test[771] <Error>: kCGErrorInvalidConnection: CGSGetCurrentCursorLocation: Invalid connection
    Aug 31 15:04:42 ****-pc.home OpenGL Test[771] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
    Aug 31 15:04:42 ****-pc.home OpenGL Test[771] <Error>: kCGErrorInvalidConnection: CGSGetCurrentCursorLocation: Invalid connection
    Aug 31 15:04:42 ****-pc.home OpenGL Test[771] <Error>: kCGErrorInvalidConnection: CGSNewWindowWithOpaqueShape: Invalid connection
    2012-08-31 15:04:42.934 OpenGL Test[771:603] GLUT Fatal Error: internal error: NSInternalInconsistencyException, reason: Error (1002) creating CGSWindow on line 263



    I took out my name, what am i doing wrong and why can't I run any of the examples in this book? Thanks for the help.

  2. #2
    Newbie Newbie
    Join Date
    Nov 2012
    Posts
    1

    Me too!

    On MacOS X 10.7, I'm trying to build a program that uses SDL as its wrapper for OpenGL, and got the same error:

    Quote Originally Posted by ShowaSanke95 View Post
    Aug 31 15:04:42 ****-pc.home OpenGL Test[771] <Error>: kCGErrorInvalidConnection: CGSGetCurrentCursorLocation: Invalid connection
    Aug 31 15:04:42 ****-pc.home OpenGL Test[771] <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
    Aug 31 15:04:42 ****-pc.home OpenGL Test[771] <Error>: kCGErrorInvalidConnection: CGSGetCurrentCursorLocation: Invalid connection
    Aug 31 15:04:42 ****-pc.home OpenGL Test[771] <Error>: kCGErrorInvalidConnection: CGSNewWindowWithOpaqueShape: Invalid connection
    2012-08-31 15:04:42.934 OpenGL Test[771:603] GLUT Fatal Error: internal error: NSInternalInconsistencyException, reason: Error (1002) creating CGSWindow on line 263
    and Googling brought me to this thread, so I tried copy/pasting in the code posted above, and got exactly the same error again. So whatever problem this example code has, seems to be present in the MacOS port of libSDL. It would be great to figure it out and help the SDL folks fix this problem.

    I compiled my example program with the following command:

    Code :
    [FONT=Courier New]gcc -o test test.c -framework OpenGL -framework GLUT[/FONT]

    My exact error message (to help other Googlers find this thread) is:

    Code :
     <Error>: kCGErrorInvalidConnection: CGSGetCurrentCursorLocation: Invalid connection
     <Error>: kCGErrorFailure: Set a breakpoint @ CGErrorBreakpoint() to catch errors as they are logged.
     <Error>: kCGErrorInvalidConnection: CGSGetCurrentCursorLocation: Invalid connection
     <Error>: kCGErrorInvalidConnection: CGSNewWindowWithOpaqueShape: Invalid connection
     GLUT Fatal Error: internal error: NSInternalInconsistencyException, reason: Error (1002) creating CGSWindow on line 263

    It would be great to figure out why CGSWindows are returning NSInternalInconsistencyException.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •