View Full Version : Mysterisou problem. What evrything can kill an OK initialized OpenGl engine ?

03-12-2002, 07:04 AM
I am about 5 weeks triyng to solve folowing a bit mysterious problem:
I am developing a bit strange OpenGl application (Direct Show
video rendering output filter witch use OpenGl for HW acclerated video effects).
The code is based on the SampWid example from DirectX 8.1 SDK.

I correcly create an active window (in CBaseWindow classe).
I correctly asociate all the rendering context, pixelformat
and I make succesfuly several opengl output to this window (Win 98SE and
w2k enviroment).
After some time (the window is still active, no OpenGl call was made) and executing some totaly diferent procedures, the window stops to recive
OpenGl commands. glGetError returns Invalid operation.
GDI command to the same windows works O.K. ....
After some time, OpenGl starts to work again correctly ..
The question is, what evrything could be a reason for such behavoiur ?

Blocking the OpenGl rendering threeed by some other thred ?

Missing the focus on the correct window ?

Some Microsof protection agains using OpenGl as the part of
Direct Show technology for video procesing ?

Any idea, ofer for cooperation, desperately wanted ....

[This message has been edited by husakm (edited 03-13-2002).]

03-12-2002, 08:35 AM
As I can't offer any help, I'll at least offer some sympathy

The worst and most tedious part of OpenGL programming on Windows must be getting around Windows itself. I spent ten times as much effort debugging and troubleshooting that aspect as I did actually useful OpenGL work.
Buuhuuuuuu. Blame Bill.


[This message has been edited by zeckensack (edited 03-12-2002).]

03-12-2002, 09:46 AM
Make sure you precede your OpenGL command batches with wglMakeCurrent(). A useful rule of thumb is to use wglMakeCurrent() after you've called PeekMessage or GetMessage, at the beginning of each callback from a window handler or MFC virtual, and (if you're paranoid) after calls to DirectGraphics.

03-13-2002, 12:15 AM
jawatte: it makes sense. The lose of OpenGl control happen exactly after calling
inocoent PeekMessage fucntions in the main program loop. I will try this.
Do you have any explanation why this happen ? Did you observed this behaviour
in any of your appplication ?
I am in a bit stupid situation. The code witch I am developing is an ActiveX dll
witch does not have the main message loop inside. It will be probably nessesery
to put the additional MakeCurrent call before any part of the dll using OpenGl :-(.

[This message has been edited by husakm (edited 03-13-2002).]