Updated JOGL Intro Chapter Online

Dear All,

I’ve just revised the introductory chapter on JOGL at the Killer Game Programming in Java website, http://fivedots.coe.psu.ac.th/~ad/jg/

It’s chapter JOGL 1, Two JOGL Programming Frameworks, located near the bottom of the page.

I’ve updated the examples to use the JSR-231 1.0.0 release and Java SE 6, and added a GLJPanel example with a simple Java 2D gradient fill background.

Comments are appreciated.

  • Andrew

Thanks for writing and revising this chapter. A couple of comments:

  • When discussing the Java2D/OpenGL pipeline (-Dsun.java2d.opengl=true), please recommend only using this with JDK 6 and later. The JDK 5 implementation causes serious problems when used in conjunction with JOGL.
  • The statement at the end of page 4 about “listener threads” is not technically correct. The real issue is that the OpenGL context is not current in the listener callbacks for mouse, keyboard, etc. events. Perhaps you can find a way to adjust the text to make it more correct while not getting into too much detail.
  • I’m not sure it’s a good idea to recommend the use of fixed-rate scheduling. Hypothetically speaking, if the time it took to render a frame was longer than the delay, then the timer would never catch up. If you switch this off, do you see a big performance difference as you did in your earlier revision?
  • The various figures look good.
  • I strongly disagree with the methodology you’re using to compute the FPS in reportStats(). You never reset the totalElapsedTime nor the frameCount so you’re always averaging in any startup transient. This is why it takes so long for you to reach the desired FPS in your output. I think you should instead choose some arbitrary number of frames to average over, say 30, and just compute the total time taken to render that number of frames and average it, as is done in e.g. the jogl-demos HDR demo. I think that if you change your measurement methodology you will see much less significant differences between fixed-rate and fixed-period scheduling.
  • GLJPanel’s speed has improved in Java SE 6, not 5. (page 14)

Overall I think this is a good introductory text for people new to 3D, Java and JOGL. Nice work.