Author Topic: Trouble running in OpenGL renderer  (Read 1734 times)

Offline orange451

  • byte
  • *
  • Posts: 19
    • View Profile
Trouble running in OpenGL renderer
« on: May 09, 2012, 01:47:19 pm »
When I add:
buffer.disableRenderer(IRenderer.RENDERER_SOFTWARE);
buffer.enableRenderer(IRenderer.RENDERER_OPENGL);

just after creafing my FrameBuffer, I get this error:
Quote
Exception in thread "main" java.lang.NoClassDefFoundError: org/lwjgl/opengl/Display
   at com.threed.jpct.GLHelper.findMode(Unknown Source)
   at com.threed.jpct.GLHelper.findMode(Unknown Source)
   at com.threed.jpct.GLHelper.init(Unknown Source)
   at com.threed.jpct.GLRenderer.init(Unknown Source)
   at com.threed.jpct.FrameBuffer.enableRenderer(Unknown Source)
   at com.threed.jpct.FrameBuffer.enableRenderer(Unknown Source)
   at com.threed.jpct.FrameBuffer.enableRenderer(Unknown Source)
   at org.orange451.game.gfx.Screen.<init>(Screen.java:36)
   at org.orange451.game.Launcher.<init>(Launcher.java:95)
   at org.orange451.game.Launcher.main(Launcher.java:25)
Caused by: java.lang.ClassNotFoundException: org.lwjgl.opengl.Display
   at java.net.URLClassLoader$1.run(Unknown Source)
   at java.net.URLClassLoader$1.run(Unknown Source)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
   at java.lang.ClassLoader.loadClass(Unknown Source)
   ... 10 more

Which other libraries (becides the jpct.jar) should I include in my buildpath to solve this issue?

Offline orange451

  • byte
  • *
  • Posts: 19
    • View Profile
Re: Trouble running in OpenGL renderer
« Reply #1 on: May 09, 2012, 02:11:19 pm »
I added lwjgl.jar and lwjgl_util.jar
now the error I get is:
Quote
Exception in thread "main" java.lang.UnsatisfiedLinkError: no lwjgl in java.library.path
   at java.lang.ClassLoader.loadLibrary(Unknown Source)
   at java.lang.Runtime.loadLibrary0(Unknown Source)
   at java.lang.System.loadLibrary(Unknown Source)
   at org.lwjgl.Sys$1.run(Sys.java:73)
   at java.security.AccessController.doPrivileged(Native Method)
   at org.lwjgl.Sys.doLoadLibrary(Sys.java:66)
   at org.lwjgl.Sys.loadLibrary(Sys.java:95)
   at org.lwjgl.Sys.<clinit>(Sys.java:112)
   at org.lwjgl.opengl.Display.<clinit>(Display.java:135)
   at com.threed.jpct.GLHelper.findMode(Unknown Source)
   at com.threed.jpct.GLHelper.findMode(Unknown Source)
   at com.threed.jpct.GLHelper.init(Unknown Source)
   at com.threed.jpct.GLRenderer.init(Unknown Source)
   at com.threed.jpct.FrameBuffer.enableRenderer(Unknown Source)
   at com.threed.jpct.FrameBuffer.enableRenderer(Unknown Source)
   at com.threed.jpct.FrameBuffer.enableRenderer(Unknown Source)
   at org.orange451.game.gfx.Screen.<init>(Screen.java:36)
   at org.orange451.game.Launcher.<init>(Launcher.java:95)
   at org.orange451.game.Launcher.main(Launcher.java:25)

Offline orange451

  • byte
  • *
  • Posts: 19
    • View Profile
Re: Trouble running in OpenGL renderer
« Reply #2 on: May 09, 2012, 05:14:45 pm »
okay, I added lwjgl.dll into my games path. Nothing errors now, but the window that comes up is just pitch black.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11745
    • View Profile
    • http://www.jpct.net
Re: Trouble running in OpenGL renderer
« Reply #3 on: May 09, 2012, 08:42:00 pm »
Any log output?

Offline orange451

  • byte
  • *
  • Posts: 19
    • View Profile
Re: Trouble running in OpenGL renderer
« Reply #4 on: May 09, 2012, 11:43:13 pm »
Any log output?
the console now says:
Quote
   at org.lwjgl.opengl.GL11.glClearColor(GL11.java:570)
   at com.threed.jpct.GLBase.clear(Unknown Source)
   at com.threed.jpct.GLRenderer.execute(Unknown Source)
   at com.threed.jpct.FrameBuffer.clearHardware(Unknown Source)
   at com.threed.jpct.FrameBuffer.clear(Unknown Source)
   at org.orange451.game.gfx.Screen.render(Screen.java:57)
   at org.orange451.game.Launcher.run(Launcher.java:84)
   at java.lang.Thread.run(Unknown Source)

Screen.Java Line 57 is:
buffer.clear(java.awt.Color.BLUE);

yes, buffer is NOT null.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11745
    • View Profile
    • http://www.jpct.net
Re: Trouble running in OpenGL renderer
« Reply #5 on: May 09, 2012, 11:44:32 pm »
Please post the complete log.

Offline orange451

  • byte
  • *
  • Posts: 19
    • View Profile
Re: Trouble running in OpenGL renderer
« Reply #6 on: May 10, 2012, 01:50:30 am »
Please post the complete log.
Quote
Java version is: 1.7.0_01
-> support for BufferedImage
Version helper for 1.5+ initialized!
-> using BufferedImage
Software renderer (OpenGL mode) initialized
Software renderer disposed
Current mode:800 x 600 x 32 @60Hz
Driver is: lmimirr/2.50.0.596 on ATI Technologies Inc. / ATI Mobility Radeon HD 4670
GL_ARB_texture_env_combine supported and used!
FBO supported and used!
VBO supported and used!
OpenGL renderer initialized (using 4 texture stages)
Software renderer disposed
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Loading Texture...from Image
Adding Lightsource: 0
32
Loading file zombie.MD2
Expanding buffers...1000000 bytes
Expanding buffers...1500000 bytes
Expanding buffers...2000000 bytes
File zombie.MD2 loaded...1782248 bytes
Magic number: 844121161
Version: 8
Skin width: 1024
Skin height: 1024
Frame size: 17276
Number of skins: 1
Number of Vertices: 4309
Number of Texture coordinates: 25230
Number of triangles: 8410
Number of GL-commands: 84101
Number of Frames: 72
Reading Texture coordinates...
Done!
Reading polygonal data...
Done!
Reading keyframes...
Done!
Coverting MD2-format into jPCT-format...
Processing: idle...
Processing: walk...
Processing: sprint...
Processing: climb...
Processing: death...
Done!
Adding Lightsource: 1
33
com.threed.jpct.FrameBuffer@3e401b01
java.lang.NullPointerException
   at org.lwjgl.opengl.GL11.glClearColor(GL11.java:570)
   at com.threed.jpct.GLBase.clear(Unknown Source)
   at com.threed.jpct.GLRenderer.execute(Unknown Source)
   at com.threed.jpct.FrameBuffer.clearHardware(Unknown Source)
   at com.threed.jpct.FrameBuffer.clear(Unknown Source)
   at org.orange451.game.gfx.Screen.render(Screen.java:57)
   at org.orange451.game.Launcher.run(Launcher.java:84)
   at java.lang.Thread.run(Unknown Source)

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11745
    • View Profile
    • http://www.jpct.net
Re: Trouble running in OpenGL renderer
« Reply #7 on: May 10, 2012, 06:59:50 am »
You seem to be doing something fishy, because you have fps output while still loading data. Keep in mind that jPCT isn't thread safe. Maybe that is the problem?