LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: renanse on November 04, 2004, 20:32:33

Title: headless rendering
Post by: renanse on November 04, 2004, 20:32:33
Hi folks,

I'm working again on implementing headless rendering support in jME for a Swing-jME integration.  Non-Headless works great already except that you have the render window sitting there behind your Swing window and it just looks bad.  Back in .90 LWJGL I started working on headless mode using pbuffer (similar to how GL4Java integrated OpenGL and Swing) but ran into the issue of not being able to create a pbuffer without a Display.   I was told this was fixed in .92 but when I try to do something like this:
headlessDisplay = new Pbuffer(width, height, format, texture);
I get an exception like this:
Quoteorg.lwjgl.LWJGLException: Could not create Pbuffer.
   at org.lwjgl.opengl.Pbuffer.nCreate(Native Method)
   at org.lwjgl.opengl.Pbuffer.createPbuffer(Unknown Source)
   at org.lwjgl.opengl.Pbuffer.<init>(Unknown Source)
   at com.jme.system.lwjgl.LWJGLDisplaySystem.initHeadlessDisplay(LWJGLDisplaySystem.java:475)
   at com.jme.system.lwjgl.LWJGLDisplaySystem.createHeadlessWindow(LWJGLDisplaySystem.java:164)
   at com.jme.app.SimpleHeadlessApp.initSystem(SimpleHeadlessApp.java:186)
   at com.jme.app.BaseGame.start(BaseGame.java:59)
   at com.mpgrealm.dirt.test.SwingTest2.main(SwingTest2.java:67)

Any ideas?  Looking at the native code it seems like a problem maybe with findPixelFormat since all the others throw an exception.
Title: headless rendering
Post by: Chman on November 05, 2004, 04:57:06
I don't think you'll be able to make LWJGL integration in Swing... For the moment, there's only a SWT binding around the web...
How, also, to instead of using PBuffer, you should look into the Display.setContext() method, it could help you :)

Chman
Title: headless rendering
Post by: renanse on November 05, 2004, 17:35:40
Actually, it works just dandy :)  I'm looking for help with standalone Pbuffers so no worries about switching of context.  but thanks.
Title: headless rendering
Post by: renanse on November 05, 2004, 19:50:20
Ok, my problem was I was passing in a RenderTexture object...  passing in null for that arg in the Pbuffer contructor ended up solving that problem.  So now I have a Swing window showing off some animated lwjgl created content via jME.  Cleaning and optimizing ahead, but I'm excited at the results.