OpenGL & glGetDoublev & glLoadMatrixD
Posted: Fri Dec 06, 2013 9:16 pm
Hello.
I'd likt to know if the OpenGL functions glGetDoublev & glLoadMatrixD work in actual MiniGL ?
The reason. Now that I have updated the AmiDARK Engine to use them ... nothing display on screen ... However I'm sure I've not done something wrong.
It's quite simple.
I create *initial* backup just after I've opened my MiniGL display using this :
Core.SystemProjection, SystemTExture & SystemModelView are defined like follow :
And then when I setup 2D, I do this :
Same for 3D rendering :
Is there something wrong in what I do ?
The result is that I get a blanking screen (flash between 2 colors, white & grey)..
Regards,
I'd likt to know if the OpenGL functions glGetDoublev & glLoadMatrixD work in actual MiniGL ?
The reason. Now that I have updated the AmiDARK Engine to use them ... nothing display on screen ... However I'm sure I've not done something wrong.
It's quite simple.
I create *initial* backup just after I've opened my MiniGL display using this :
Code: Select all
glGetDoublev( GL_PROJECTION_MATRIX, Core.SystemProjection );
glGetDoublev( GL_TEXTURE_MATRIX, Core.SystemTexture );
glGetDoublev( GL_MODELVIEW_MATRIX, Core.SystemModelView );
Code: Select all
struct CoreStruct{
...
double SystemTexture[ 16 ];
double SystemModelView[ 16 ];
double SystemProjection[ 16 ];
...
}
Code: Select all
void GLSet2DRenderMode( void ){
if ( Core.CurrentDisplayMode != 2 ){
glMatrixMode( GL_PROJECTION );
glLoadMatrixd( Core.Default2DProjection );
glViewport( 0, 0, deGetDisplayWidth(), deGetDisplayHeight() );
glOrtho( 0, (GLdouble)deGetDisplayWidth() -1, 0, (GLdouble)deGetDisplayHeight() -1, -1, 1 );
glRasterPos2i( 0, 0 );
glMatrixMode( GL_TEXTURE );
glLoadMatrixd( Core.Default2DTexture );
glMatrixMode( GL_MODELVIEW );
glLoadMatrixd( Core.Default2DModelView );
// Extra OpenGL options à définir pour la 2D.
glDisable( GL_LIGHTING );
glDisable( GL_DEPTH_TEST );
// Set Mode 2
Core.CurrentDisplayMode = 2;
}
}
Code: Select all
void GLSet3DRenderMode( void ){
if ( Core.CurrentDisplayMode != 1 ){
glMatrixMode( GL_PROJECTION );
glLoadMatrixd( Core.Default3DProjection );
glViewport( 0, 0, deGetDisplayWidth(), deGetDisplayHeight() );
gluPerspective( 60.0, ( (float) deGetDisplayWidth() / (float) deGetDisplayHeight() ), 2.0f, 3000.0f );
glMatrixMode( GL_TEXTURE );
glLoadMatrixd( Core.Default3DTexture );
glMatrixMode( GL_MODELVIEW );
glLoadMatrixd( Core.Default3DModelView );
// Set Mode 1
Core.CurrentDisplayMode = 1;
}
}
The result is that I get a blanking screen (flash between 2 colors, white & grey)..
Regards,