Mac Bug: Inverted Y

Started by psiegel, May 15, 2004, 12:51:58

Previous topic - Next topic

psiegel

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

princec

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 :)

cfmdobbie

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.
ellomynameis Charlie Dobbie.

Jeramie

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.