Hello Guest

[FIXED] Display Mode dimensions not updated when parent canvas resizes

  • 9 Replies
  • 10589 Views
Basically, when I pop the Display onto a canvas in a JFrame, and resize the JFrame, I can have the area I render to resize with the canvas if I make calls to glViewport that reference the size of the canvas.
Code: [Select]
glViewport(0, 0, parent.getWidth(), parent.getHeight());
However, if I make that call reference the dimensions in the DisplayMode (which I would hope would return the same values), like this:
Code: [Select]
glViewport(0, 0, Display.getDisplayMode().getWidth(), Display.getDisplayMode().getHeight());
Then the values return by getWidth() and getHeight() haven't changed from their initial settings, and I'm rendering to the same section of the canvas as before.

This seems like a bug - obviously, the DisplayMode's dimensions have changed, because the enlarged canvas means I can render to a bigger area. Could this be fixed in the next release?

Re: Display Mode dimensions not updated when parent canvas resizes
« Reply #1 on: May 31, 2011, 14:01:21 »
In hindsight, this should be in Bug Reports / RFE.

*

Offline kappa

  • *****
  • 1316
Re: Display Mode dimensions not updated when parent canvas resizes
« Reply #2 on: May 31, 2011, 14:17:41 »
In hindsight, this should be in Bug Reports / RFE.

Moved to bug section.

I'm not sure but i'm guessing this is related to this bug.

My impression of the bug is that it seems like the Display is adjusted but the settings in the DisplayMode are not updated to reflect the new dimensions. DisplayMode.getWidth() and getHeight() return the same values as before the resize, even though the Display is rendered on a larger canvas.

Obviously, this is just an guess based on a few minor runs - nothing involving a Mouse or anything like that.

*

Offline spasi

  • *****
  • 2208
    • WebHotelier
The next nightly build will have a fix for this.

Sweet.

When is the next LWJGL release coming out, btw?

*

Offline spasi

  • *****
  • 2208
    • WebHotelier
Depends on how quickly we'll get feedback on the OpenGL ES implementation. The NV video extensions need to be tested as well. We'll take our time I guess, no other features or fixes have been implemented since the last release.

K.

I did some tests with the Mouse, and Mouse behavior works perfectly fine with a resizing Canvas. The only bug I'm seeing is in how the DisplayMode's dimensions are reported.

*

Offline spasi

  • *****
  • 2208
    • WebHotelier
The only bug I'm seeing is in how the DisplayMode's dimensions are reported.

What do you mean?

The bug I mentioned at the start of this thread - when the Canvas a Display is on is resized, the DisplayMode's dimensions are not updated. Kappa pointed to another bug he was guessing was related, and I was saying that the mouse worked fine for me after some initial testing.