Can AWT possibly GET any slower?!

I’m programming a 3d game in jogl, nothing fancy (yet…), and I have a somewhat satisfactory rate of 46 fps for 7,000 textured polygons, with lighting. That is, until I use awt to draw ONE IMAGE (158 x 1024) to the screen each time the display loop is called. This drops the performance to an abyssmal 25 fps. How is it possible that drawImage(), which is only called once per render, takes about as long as the entire 3d textured world does to render?? Isn’t there any faster way to draw to the window directly? It’s just ridiculous…

Why not use openGL to draw the image too?

I had thought of texturing a polygon but I doubt I could ever center and angle it exactly right, so that each and every pixel ends up where it’s supposed to be. Besides what if another polygon intersects it? I’ll have polygons going through the control panel!

Drawing to the window directly is a problem because of the type of canvas JOGL is using.

Using GL to draw your image would be much smarter. You could adjust the matrix using glOrtho() to align it to the screen.

Kev

And if you place your near clipping plane intelligently and/or disable the z buffer test and draw the control panel last, you won’t have intersecting polygons from the world. Rendering everything from GL really is the smartest move.

  • elias

hmmm… alright, thanks!