glGenVertexArrays() crashing DerelictGL3 program

196 Views Asked by At

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.

1

There are 1 best solutions below

1
On

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.