I am new to jogl and OpenG开发者_开发问答l in general, in one tutorial I have encountered glutInitDisplayMode function call, what is it analogue in jogl?
There is no direct analog. GLUT associates OpenGL more or less directly with a display window.
With JOGL, you create a canvas, then associate the canvas with the window. Creating the canvas looks something like this:
GLProfile profile = GLProfile.getDefault();
GLCapabilities capabilities = new GLCapabilities(profile);
GLCanvas canvas = new GLCanvas(capabilities);
After that, the details vary depending on the window toolkit (AWT, SWT, Swing, etc.) you're going to use. There's not much difference between Swing and AWT: you create a frame, add the canvas to the frame, and add an EventListener for OpenGL events (reshape, draw, etc.) As I recall, SWT changes things a bit more, but it's been long enough that I don't remember the details.
精彩评论