From 0ad5b74051e48994087484168ee2b512fb843b94 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Thu, 6 Mar 2003 09:58:25 +0000 Subject: [PATCH] work around another (easy) gldirect bug --- stepmania/src/RageDisplay.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/stepmania/src/RageDisplay.cpp b/stepmania/src/RageDisplay.cpp index b2b2de967a..05ffab9f8b 100644 --- a/stepmania/src/RageDisplay.cpp +++ b/stepmania/src/RageDisplay.cpp @@ -145,7 +145,19 @@ void RageDisplay::SetupOpenGL() /* Initialize the default ortho projection. */ glMatrixMode( GL_PROJECTION ); glLoadIdentity(); - glOrtho(0, SCREEN_WIDTH, SCREEN_HEIGHT, 0, SCREEN_NEAR, SCREEN_FAR ); + + float left = 0, right = SCREEN_WIDTH, bottom = SCREEN_HEIGHT, top = 0; + if(strncmp((const char*)glGetString(GL_RENDERER),"GLDirect",strlen("GLDirect"))==0) + { + /* GLDirect incorrectly uses Direct3D's device coordinate system + * instead of OpenGL's, so we need to compensate. */ + left += 0.5f; + right += 0.5f; + bottom += 0.5f; + top += 0.5f; + } + + glOrtho(left, right, bottom, top, SCREEN_NEAR, SCREEN_FAR ); glMatrixMode( GL_MODELVIEW ); }