MiniGL glCopyPixels bug ?
Posted: Sat Feb 16, 2013 11:01 pm
Hello,
When I want to copy the front buffer to the back buffer, I use glCopyPixels.
I know it's slow but it's the only solution I've found to backup the last drawn frame.
(it's mainly used for 2D).
So, I supposed that it should work this way :
but it don't work... the background scroll down each frame....
To get the wanted result (no scroll), I need do this :
Is it normal that I must put Raster Pos to (0.0, 0.5) instead of (0.0, 0.0) ?
Strange behaviour.. Is this a bug ?
Regards,
AmiDARK
When I want to copy the front buffer to the back buffer, I use glCopyPixels.
I know it's slow but it's the only solution I've found to backup the last drawn frame.
(it's mainly used for 2D).
So, I supposed that it should work this way :
Code: Select all
glViewport( 0, 0, BasicSetup.DisplayWIDTH, BasicSetup.DisplayHEIGHT );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
gluOrtho2D( 0, BasicSetup.DisplayWIDTH -1, 0, BasicSetup.DisplayHEIGHT -1 );
glReadBuffer( GL_FRONT ); glDrawBuffer( GL_BACK );
glRasterPos2i( 0, 0 );
glCopyPixels( 0, 0, BasicSetup.DisplayWIDTH, BasicSetup.DisplayHEIGHT, GL_COLOR );
To get the wanted result (no scroll), I need do this :
Code: Select all
glViewport( 0, 0, BasicSetup.DisplayWIDTH, BasicSetup.DisplayHEIGHT );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
gluOrtho2D( 0, BasicSetup.DisplayWIDTH -1, 0, BasicSetup.DisplayHEIGHT -1 );
glReadBuffer( GL_FRONT ); glDrawBuffer( GL_BACK );
glRasterPos2f( 0.0f, 0.5f );
glCopyPixels( 0, 0, BasicSetup.DisplayWIDTH, BasicSetup.DisplayHEIGHT, GL_COLOR );
glReadBuffer( GL_BACK );
glEnable( GL_SCISSOR_TEST );
Strange behaviour.. Is this a bug ?
Regards,
AmiDARK