kimziv / oglsuperbible5

GLTools and OpenGL SuperBible (5th Edition) OpenGL超级宝典第五版
41 stars 16 forks source link

Segfault in Perspective example on Linux #17

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. cd into Linux/Chapter11/Perspective
2. run make
3. run ./Perspective

It issues a segmentation fault.

What is the expected output? What do you see instead?

Just the segfault above.

What version of the product are you using? On what operating system?

svn co for non-registered members checked out Dec. 30, 2010.

Ubuntu (kubuntu variant) Linux, gcc 4.4.5, nvidia binary driver 260.19.06 on 
X.org 1.9, GLX ver. 1.4, OGL 3.3.

Please provide any additional information below.

Not sure what else to add.

Original issue reported on code.google.com by gcana...@gmail.com on 31 Dec 2010 at 4:25

GoogleCodeExporter commented 9 years ago
Try adding the marked lines at main()

--->glewExperimental = GL_TRUE; 
    GLenum err = glewInit();
    if (GLEW_OK != err) {
        fprintf(stderr, "GLEW Error: %s\n", glewGetErrorString(err));
        return 1;
    }

    SetupRC();
--->ChangeSize(1,1); //see issue #10 for more on this
    glutMainLoop();
    ShutdownRC();

Original comment by alkin...@gmail.com on 5 Feb 2011 at 6:40