[LWJGL] Problem with Viewport and Windows Aero vs. Basic

Hello,

today I used a different PC than I’m usually using for my OpenGL development. On my standard PC I run Win7 with Windows Aero … everything works just fine. But on this new maschine I get a different result using Viewports:

Normal PC / different PC with basic (intended):

different PC with Aero (problem):

It appears that for same reason the glViewport(5, 5, widht, height) gets transformed to glViewport(10, 0, width, height) … or something like that. I checked the glViewport call and the values are correct but the result stays flawed.
Also interesting: as soon as I change the displayMode or manually resize the window the viewport gets applyed correctly.

Can someone explain why this problem occurs?
Thanks!

Ooof…this might be an LWJGL bug. Are you using the latest version?

I’m using 2.8.5 which should be the latest version. If someone has an idea feel free to post here. I think I might post it in the lwjgl forums as well an see if I get an answer there.

Give us code, so we can actually make some informed suggestions. :point:

Sorry this comes two days late, had lots of work to do. Here some code:

glInit (Display)

	private void glInitContext() {
		DisplayMode displayMode = new DisplayMode(main.getWidth(), main.getHeight());
		windowDimensions = new int[] { 0, 0, main.getWidth(), main.getHeight() };
		PixelFormat pixelFormat = new PixelFormat().withSamples(8);
		try {
			Display.setDisplayMode(displayMode);
			Display.create(pixelFormat);
			Display.setTitle(title);
			Display.setResizable(resizable);
		} catch (LWJGLException e) {
			e.printStackTrace();
		}
		glEnable(GL_DEPTH_TEST);
		glDepthFunc(GL_LEQUAL);
		glDepthMask(true);
		glDepthRange(0.0f, 1.0f);
		glEnable(GL_BLEND);
		glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
		glEnable(GL_MULTISAMPLE);
		glEnable(GL_SCISSOR_TEST);
		glViewport(0, 0, Display.getWidth(), Display.getHeight());
		glScissor(0, 0, Display.getWidth(), Display.getHeight());
		EPHVertexArrayObject.glInitShaderProgramPool(shaderParentPath);
		glInitialized = true;
		synchronized (glInitMonitor) {
			glInitMonitor.notifyAll();
		}
	}

glDraw (VAO)

public synchronized void glRender() {
		if (handle < 0 || !updated) glInit();
		if (size > 0 && hasVisibleEntries()) {
			glBindVertexArray(handle);
			glViewport(viewPortRect[0], viewPortRect[1], viewPortRect[2], viewPortRect[3]); // viewportRect is set correctly
			glScissor(scissorRect[0], scissorRect[1], scissorRect[2], scissorRect[3]); // scissorRect is also set correctly
                        // Binding the Program
                        // upload the uniforms
                        // glDrawElements(...)
                        // unbind the Program
			glBindVertexArray(0);
		}
	}

I’m not too sure what kind of code you’d like to see … I thought this are the parts where the viewport is important .

I know this comes late, but I finally managed to resolve the problem and for further reference here the solution (that worked for me):
For some reason the LWJGL Display bugs out if you issue Display.create(…) before the Display.setResizable(true). So the solution for me was changing

//...
Display.setDisplayMode(displayMode);
Display.create(pixelFormat);
Display.setResizable(resizable); // true
// ...

to

// ...
Display.setDisplayMode(displayMode);
Display.setResizable(resizable); // true
Display.create(pixelFormat);
// ...