Segmentation fault at glGenVertexArrays( 1, &vao );

后端 未结 4 1339
我在风中等你
我在风中等你 2020-11-29 00:48

My gdb backtrace gives:

(gdb) backtrace
#0  0x00000000 in ?? ()
#1  0x0804a211 in init () at example1.cpp:147
#2  0x0804a6bc in main (argc=1, argv=0xbffff3d4         


        
相关标签:
4条回答
  • 2020-11-29 01:28

    Works fine for me:

    screenshot

    GL_VERSION  : 4.1.10750 Compatibility Profile Context
    GL_VENDOR   : ATI Technologies Inc.
    GL_RENDERER : AMD Radeon HD 6500 Series
    

    EDIT: I'm using the latest versions of FreeGLUT (2.8.0 RC2) and GLEW (1.7.0), which may make a difference if you're relying on distro-supplied versions.

    0 讨论(0)
  • 2020-11-29 01:32
    glewExperimental = GL_TRUE; 
    glewInit();
    

    Should do the magic


    Experimental Drivers

    GLEW obtains information on the supported extensions from the graphics driver. Experimental or pre-release drivers, however, might not report every available extension through the standard mechanism, in which case GLEW will report it unsupported. To circumvent this situation, the glewExperimental global switch can be turned on by setting it to GL_TRUE before calling glewInit(), which ensures that all extensions with valid entry points will be exposed.

    0 讨论(0)
  • 2020-11-29 01:32

    Ubuntu 10.04 for example comes with glew 1.50 which glGenVertexArrays doesn't work without the glewExperimental flag. so it is glew version dependent

    0 讨论(0)
  • 2020-11-29 01:33

    Have you tried testing on other systems with different graphics cards? If your code meets the OpenGL spec and it mysteriously crashes inside a function that is correctly called with valid parameters, it could well be a driver bug. If it's a driver bug, you're reduced to guesswork, making shotgun changes, and gradually building up a healthy exasperation that a huge corporation with billions of dollars produce absolutely crap excuses for a graphics card driver. Good luck!

    0 讨论(0)
提交回复
热议问题