Hey guys I made a class that will run the canvas in a window if the new plugin is detected.
its attached to this post.
as before, test case:
have2chat.net/fvfKeys 1, 2 switch between display types
This will help you if you dont have access to a Mac, and would like to run LWJGL but cant debug it.
Usage:
instead of creating a new Canvas().
use:
rContainer = new ResizableContainer(false);
Canvas canvas = rContainer.getCanvas();
the boolean variable in the ResizableContainer constructor is if you will
be using resizable applets (set your applet size in percentage) then set it true.
setup your canvas as usual (as if it was to run in an applet) before attaching the display,
but instead of using Display.setPerant(...);
use:
rContainer.attachDisplay();
and once every game cycle call this method
rContainer.checkResize()
you may notice that checkResize() returns a boolean value, I use this to
reset the GL viewport if needed.
you probably wont need the return value if you dont use resizable applets.
Other useful methods.
in order to get the current width and height use:
Canvas canvas = rContainer.getCanvas();
if (canvas != null) {
canvas.getWidth();
canvas.getHeight();
}
if the canvas is "null" then you will need to get the current DisplayMode, as it means you are running in fullscreen mode.
to set canvas screen mode if possible:
rContainer.setFullscreen(null); //SWITCH BETWEEN FULLSCREEN / APPLET
rContainer.setWindow(); //SWITCH BETWEEN WINDOW / APPLET
*note that this wont be the final version, as soon as a opengl supported mac update is released so will this class.