Ok,
I took a lazy approach and simply disabled some open api calls which were
probably queueing opengl commands.
Then I started to get a hunch for what the problem was:
It turns out the "double" buffering is causing a major slowdown:
When mOptionDoubleBufferEnabled is set to true, things become extremely
slow.
When mOptionDoubleBufferEnabled is set to false, everything runs faster, but
the drawing starts to flicker
I don't think GDI would flicker that much... this means opengl software
driver just sucks compared to gdi.
// if double buffering is enabled then draw to backbuffer
if mOptionDoubleBufferEnabled then
begin
mOpenGLAPI.glDrawBuffer( GL_BACK );
end else
// else draw to front buffer
begin
mOpenGLAPI.glDrawBuffer( GL_FRONT );
end;
.... opengl draw codes...
// if double buffering is enabled then we still need to copy it to the
front buffer
if mOptionDoubleBufferEnabled then
begin
mOpenGLAPI.glReadBuffer( GL_BACK );
mOpenGLAPI.glDrawBuffer( GL_FRONT );
mOpenGLAPI.glCopyPixels( 0, 0, ClientWidth, ClientHeight, GL_COLOR);
end;
mOpenGLAPI.glFlush;
Bye,
Skybuck.