Slick Forums

Discuss the Slick 2D Library
It is currently Wed May 22, 2013 6:48 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Thu Feb 16, 2012 3:20 pm 
Offline

Joined: Mon Sep 12, 2011 4:56 pm
Posts: 8
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.


Top
 Profile  
 
PostPosted: Thu Feb 16, 2012 4:43 pm 
Offline
Slick Zombie

Joined: Sat Jan 27, 2007 7:10 pm
Posts: 1469
What about CanvasGameContainer (putting your game into a Swing container)? This is what most of us use for Swing-based editors/toolsets.


Top
 Profile  
 
PostPosted: Fri Feb 17, 2012 12:31 am 
Offline
Oldbie
User avatar

Joined: Thu Jan 13, 2011 4:42 pm
Posts: 349
I have heard that a slick util is provided for those who want to use the tools of slick, but not the entire framework. You can find out more if you look at the manual under slick framework. Does this help?

_________________
"Artificial intelligence will never be a match for human stupidity" - "Jamos Kennedynos"


Top
 Profile  
 
PostPosted: Fri Feb 17, 2012 6:02 am 
Offline

Joined: Mon Sep 12, 2011 4:56 pm
Posts: 8
davedes,
Like I said, I don't actually want to use Slick2D's drawing or anything. I just want to be able to construct the objects so i can convert them to XML with my configuration library.
But thanks for the suggestion.

Mr. Kenkron,
Awesome. For anyone who might stumble upon this thread, info can be found here and javadocs here.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group