<first post!>
Reason: Support for LWJGL .92
Classes changed: LWJGLFont, LWJGLRenderer, LWJGLTextureRenderer, LWJGLDisplaySystem,LWJGLPropertiesDialog, LWJGLTimer
Code changes:
Basicly, whenever we did Window.getWidth() a lot, I would create a class variable
DisplayMode window=Display.getDisplayMode();
and just do
window.getWidth();
Inside LWJGLTextureRenderer.initPBuffer(), I changed
pbuffer = new Pbuffer(PBUFFER_WIDTH, PBUFFER_HEIGHT, 32, 0, 8, 0, 0, texture);
to:
pbuffer = new Pbuffer(PBUFFER_WIDTH, PBUFFER_HEIGHT, new PixelFormat(32, 0, 8, 0, 0), texture);
I changed the following class inside LWJGLPropertiesDialog from:
private class DisplayModeSorter implements Comparator {
/**
* @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
*/
public int compare(Object o1, Object o2) {
DisplayMode a = (DisplayMode)o1;
DisplayMode b = (DisplayMode)o2;
//Width
if (a.width != b.width)
return (a.width > b.width) ? 1 : -1;
//Height
if (a.height != b.height)
return (a.height > b.height) ? 1 : -1;
//Bit depth
if (a.bpp != b.bpp)
return (a.bpp > b.bpp) ? 1 : -1;
//Refresh rate
if (a.bpp != b.bpp)
return (a.bpp > b.bpp) ? 1 : -1;
//All fields are equal
return 0;
}
}
to:
private class DisplayModeSorter implements Comparator {
/**
* @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
*/
public int compare(Object o1, Object o2) {
DisplayMode a = (DisplayMode)o1;
DisplayMode b = (DisplayMode)o2;
//Width
if (a.getWidth() != b.getWidth())
return (a.getWidth() > b.getWidth()) ? 1 : -1;
//Height
if (a.getHeight() != b.getHeight())
return (a.getHeight() > b.getHeight()) ? 1 : -1;
//Bit depth
if (a.getBitsPerPixel()!= b.getBitsPerPixel())
return (a.getBitsPerPixel() > b.getBitsPerPixel()) ? 1 : -1;
//Refresh rate
if (a.getFrequency()!= b.getFrequency())
return (a.getFrequency()> b.getFrequency()) ? 1 : -1;
//All fields are equal
return 0;
}
}
Inside LWJGLTimer's constructor, I removed the function call
Sys.setTime(0);
and removed the function LWJGLTimer.setTime(long)
Inside LWJGLDisplaySystem.initSystem(), there is simply
Display.setFullscreen(fs);
Display.setDisplayMode(mode);
Display.create();
Instead of testing if it's fullscreen, and if not creating an x/y and moving the window to the correct place
(can't move the windows display I believe.
I tried all test. They seem to work from what I can tell, plus the added bonus of being able to finally debug LWJGL programs in Linux.