Lacklustre performance when porting from Java2D to JOGL

Hello,

Any suggestions why porting a basic 2D sprite-based game framework from Java2D to Jogl would result in much poorer frame rates?

Java2D framerates max around 150 FPS
Jogl framerates max around 70 FPS

I’m using Java 1.5/most recent stable release of Jogl

Jogl reports:
Vendor: NVIDIA Corporation
Renderer: GeForce 6600 GT/PCI/SSE2/3DNOW!

I’m initialising as follows:
gl = drawable.getGL();
gl.glEnable( GL.GL_TEXTURE_2D );
gl.glClearColor( 0.0f, 0.0f, 0.0f, 0.0f );
gl.glViewport( 0, 0, width_, height_ );
gl.glDisable( GL.GL_DEPTH_TEST );

(I’m using what appears to be a fairly common openGL texturing method for rendering : quads textured to match sprite images)

Any ideas where to look for performance bottlenecks without resorting to posting loads of code?

Cheers.

Have you tried calling gl.setSwapInterval(0) in your init() method?

Groovy.

Thanks Ken, that worked a treat.

Now getting CPU-based bottleneck around 650 FPS

Apologies to those who know this already but a little searching reveals my previous 70 FPS to be the default OpenGL swap interval

  • based on my current monitor refresh rate.

Now to get OpenAL up and running…