Is there some sane way to be able to use Slick's Animation/Image/SpriteSheet classes without starting up a full Slick2D container? I tried my hand at some OpenGL initialization but keep getting null pointers or other strange errors.
Background:
I'm working on a configuration tool for my Slick-based game(s) that will be written in Swing. Basically I want my Swing tool to be able to load up configurations and create objects that my game will use... only those objects include Slick's Animation, Image, SpriteSheet, etc. I picked Swing for my tool because I don't like doing GUIs in OpenGL.
My first attempt:
Code:
// Init Slick2D/LWJGL manually.
try
{
Display.setDisplayMode( new DisplayMode( 1, 1 ) );
Display.setFullscreen( false );
SGL GL = Renderer.get();
GL.initDisplay( 1, 1 );
GL.enterOrtho( 1, 1 );
Graphics g = new Graphics( 1, 1 );
g.setDrawMode( Graphics.MODE_NORMAL );
Graphics.setCurrent( g );
}
catch( LWJGLException e )
{
e.printStackTrace();
}
Which gives the error:
Code:
Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at org.lwjgl.opengl.GL11.glGetString(GL11.java:1771)
at org.newdawn.slick.opengl.renderer.ImmediateModeOGLRenderer.initDisplay(ImmediateModeOGLRenderer.java:32)
at [ GL.initDisplay( 1, 1 ); ]
Any suggestions are welcome. Thanks.