From 1.1.4 to 2.1.0 - changed behaivor

Started by Nitram, April 20, 2009, 05:21:29

Previous topic - Next topic

Nitram

Hello,

we are currently updating a working client software for a game from LWJGL 1.1.4 to 2.1.0. Sadly we had to notice that there are some differences between both versions that ended up in a black screen. We were able to find the differences in the functions GL11.glScalef and GL11.glTranslatef. In version 1.1.4 that functions used absolute values. Now out of all sudden all values need to be relative to the width and the heigth of the viewport.
The used matrix type is the modelview matrix.

Hoping that you know what I mean the question is, if its possible to make lwjgl 2.1.0 handling the values in the same way as version 1.1.4 did.

Nitram

Ciardhubh

I don't think anything changed for glScalef and glTranslatef.

However, if I remember correctly, LWJGL 2.0 made some changes to its default OpenGL state. The default projection and/or viewport were set to something LWJGL-specific before and were switched to the OpenGL default with 2.0. At least that's what I remember reading somewhere.

Fool Running

What Ciardhubh said is correct. The default state was changed to the OpenGL specification default state.
The code that was used to set it up in 1.1.4 and removed in 2.0 is:
// Put the window into orthographic projection mode with 1:1 pixel ratio.
		// We haven't used GLU here to do this to avoid an unnecessary dependency.
		GL11.glMatrixMode(GL11.GL_PROJECTION);
		GL11.glLoadIdentity();
		GL11.glOrtho(0.0, current_mode.getWidth(), 0.0, current_mode.getHeight(), -1.0, 1.0);
		GL11.glMatrixMode(GL11.GL_MODELVIEW);
		GL11.glLoadIdentity();
		GL11.glViewport(0, 0, current_mode.getWidth(), current_mode.getHeight());
		// Clear window to avoid the desktop "showing through"
		GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);

Hopefully if you do that before you start drawing, everything will be as it was before. ;D
Programmers will, one day, rule the world... and the world won't notice until its too late.Just testing the marquee option ;D