LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: psiegel on May 15, 2004, 12:51:58

Title: Mac Bug: Inverted Y
Post by: psiegel on May 15, 2004, 12:51:58
So, I've been doing 2D blitting, and wanted my origin to be the top left corner of the screen rather than the bottom left to more closely match other 2D blitters.  To do this, I used the following code in my initialization:


GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();      
GLU.gluOrtho2D(0, w,  h, 0);


This worked fine on Windows and Linux, but my Mac tester reported that everything appeared upside down!  I eventually reverted to the following:


GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glLoadIdentity();      
GLU.gluOrtho2D(0, w, 0, h);


And manually inverted the y axis of each individual blit.  This fixed the problem on Mac, and still worked fine in Windows and Linux.  So I have a viable work-around, I just wanted to report the issue in case it could be addressed in a future release.

Paul
Title: Mac Bug: Inverted Y
Post by: princec on May 16, 2004, 10:46:38
Nothin' we can do about it I'm afraid without more "code pollution". If that's how the Mac GL drivers work then that's how it works - and it's a bug which Apple need to know about.
<edit>Unless it's a bizarre bug in the GLU code but I doubt it...

Cas :)
Title: Mac Bug: Inverted Y
Post by: cfmdobbie on May 16, 2004, 12:04:27
Quote from: "princec"<edit>Unless it's a bizarre bug in the GLU code but I doubt it...

Nope:

public static void gluOrtho2D(
float left,
float right,
float bottom,
float top) {

GL11.glOrtho(left, right, bottom, top, -1.0, 1.0);
}


Must be an OSX bug.
Title: Mac Bug: Inverted Y
Post by: Jeramie on July 04, 2004, 09:20:38
Are ya'll sure nothing changed between 0.7 and 0.9 in this regard? On the Mac, our client works fine for 0.7, but it appears our 2D font texture comes out upside down on 0.9. Works correctly on the PC for both versions.