akgreene
November 23rd, 2004, 01:09 PM
Hi all,
I tried to create an MFC OpenGl control, similar to the one in this article: http://steinsoft.net/index.php?site=Programming/Tutorials/opengl_dialog. It seems to work and draw fine in general, unless I try to use a timer in the dialog that contains the OpenGl control. Then my timer never gets triggered. If I add a line that says CPaintDC dc(this) to the beginning of the OnPaint() function of the control, then the timer gets triggered, but then the rendering doesn't work. Does anyone know what the cause of this could be?? I've seen other tutorials that created the gl context during each OnPaint call, but that seems a little excessive. Is that a better way?
Thanks,
akgreene
I tried to create an MFC OpenGl control, similar to the one in this article: http://steinsoft.net/index.php?site=Programming/Tutorials/opengl_dialog. It seems to work and draw fine in general, unless I try to use a timer in the dialog that contains the OpenGl control. Then my timer never gets triggered. If I add a line that says CPaintDC dc(this) to the beginning of the OnPaint() function of the control, then the timer gets triggered, but then the rendering doesn't work. Does anyone know what the cause of this could be?? I've seen other tutorials that created the gl context during each OnPaint call, but that seems a little excessive. Is that a better way?
Thanks,
akgreene