I am writing a multithreaded MFC program. There are two threads: One
does some processing on each of several models and sends messages to the
second, which draws the models.
The second thread has two methods that may be activated by the messages
from the first. One is OnPaint, and the other is my own DrawModel.
DrawModel is called for each model and the OnPaint is called to start
the next frame. The OnPaint method draws some axis, swaps the back
buffer into the front, and the clears the back buffer, in that order.
This all works fine. If I call glGetError in this method it returns
GL_NO_ERROR.
The DrawModel method works fine in that it gets called and does all the
non openGL stuff in it. But none of the openGL commands are executed
and if I call glGetError I get GL_INVALID_OPERATION. If I loop around
only calling glGetError and reporting the error, I still get
GL_INVALID_OPERATION every time, which makes me think that the
glGetError funtion itself is causing an error.
Any ideas what could be wrong? I use the OnPaint method by calling the
InvalidateRect(NULL, FALSE) method. Is there something that
InvalidateRedt does that I need to do when I call DrawModel?