Search code examples
c++openglwxwidgets

glGenLists(1) return 0 outside OnPaint() with wxThread


Currently, I am trying to separate the display list from the OnPaint(), but glGenLists(1) return 0.

Is there any prerequisite on using display list?
Is function glGenLists(1) only survive inside OnXxx() event thread?

Thank you!


Solution

  • The only requirement is having a valid OpenGL context made current. You probably don't have one. If you use multiple threads, you need to use multiple GL contexts which share objects.