📅 2014-Jul-22 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ error, glew, opengl, wxwidgets ⬩ 📚 Archive
I had a simple graphics program written using OpenGL and using GLUT for windowing. To get more windowing functionality, I wanted to move it to wxWidgets. I picked an example program that uses OpenGL in wxWidgets. It compiled and worked correctly. When I placed my OpenGL code into this example, I got a segmentation fault at the glCreateShader
call in my code.
I had a glewInit
in my original code. I had put this in the application class constructor. Apparently, wxWidgets requires that the first OpenGL or GLEW call be placed inside the OnPaint
event handler function. Look for EVT_PAINT
to find this function. Once I did that, the error disappeared and OpenGL worked.