draw without paint

Hi, Using delphi I am trying to render a directshow clip using a callback function. For ages nothing worked until I realised glDrawPixels does not force opengl to render the pixels. I then saved the frame in a temporary buffer and called refresh. In the Opengl draw method I used glDrawPixels to draw the frame from the temporary buffer. This works fine but how can I avoid the copy. Is there a way to force opengl to render without forcing a paint.


You may have to call glFlush to empty all command buffers and force their execution. Actually, if you are using double buffering, you just have to call the “swapbuffers” command and refresh the screen. Then I don’t know the function name in Delphi.

thanks, had tried glFlush and SwapBuffers(DC) without success. It may be that the callback is from another thread and calling Refresh posts a paint message.

Take care that all opengl commands are issued from the thread in which the opengl rendering context is created. Otherwise create a context in each thread.
I am sorry, I don’t have any experience with delphi, so I don’t have more ideas… Perhaps you will find more help on delphi related forums or a more general one.

Can you post the relevant parts of the code and tell us what is being called when.
Is everything being done in the main thread or are you creating TThread objects ?
Is the OpenGL window in a Delphi form ?
If it is a Delphi form do you override the CreateParams procedure to set the window parameters, and do you have an ERASEBKGND message handler that sets Message.Result := 1 ?