简体   繁体   中英

glGenVertexArrays() crashing DerelictGL3 program

The function calls glBindVertexArray(0) , glGenVertexArrays(1, &vertex_array_object) and glBindVertexArray(vertex_array_object) cause my program to crash. When I run the code if(glGenVertexArrays == null) it evaluates true. This leads me to believe I'm not loading the functions properly. I'm using DerelictGL3.load() and DerelictGL3.reload() to load my functions but I'm not sure it's working. Other functions do seem to load though, only functions pertaining to the vertex array object crash the program.

Edit: I'm not sure what the actual problem is but it seems to be related to the way Mac OSX loads OpenGL functions. My code does not crash on Linux.

Before calling DerelictGL3.reload() be sure to have an active OpenGL context created (through SDL or SFML or whatever other technique you use). Else you'll get function pointers only for a minimal OpenGL subset, something like OpenGL 1.1.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM