Program Crash on glGenVertexArrays call

后端 未结 3 2031
自闭症患者
自闭症患者 2021-02-07 17:09

I am trying to learn how to program in opengl and am using this tutorial. Tutorial 1 works fine, tutorial 2 crashes with return 1.

It fails on this:

GLu         


        
3条回答
  •  一生所求
    2021-02-07 17:48

    Using OpenGL 4.3 on an nvidia GPU and GLEW this trick still works.

    i was able to use this fix to get the 'Our First Program: A Detailed Discussion' from the 8th edition 4.3 Chapter 1 to run.

    commenting out

    glewExperimental = GL_TRUE; 
    

    results in an unhandled exception, so i'm fairly certain this is the issue. add it back into the code and the program runs as expected.

    Updating answer to clarify what is new from original answer:

    [1] Notice the date on the original answer was over two years old so i validated this is still true in newer versions of OpenGL. A major issue with OpenGL sample code on the web is the aging of tutorial content that might still work but is not considered a best practice or most performant path. When I read the original answer my thoughts were:

    'Well, but this is two years old...is GLEW still not updated and this answer is out of date?', so now the reader will know as of Sept 13, 2014 it is in fact true.

    [2] I would expect many readers trying to make the very simple first example in the OpenGL Programmer's Guide to run and it will not without this fix. By including the name of the book I hope they turn up this answer in a web search.

    [3] I specified the platform I am certain this works to clarify I did not test it on all platforms.

提交回复
热议问题