I was wondering if it was possible to make a class that was an extension of GLJPanel and how I would go about doing it. When I tried just doing it basically it gave me a no-constructor error. This really is the ideal way for me to be able to do things too, so I don’t care if its difficult (just not TOO difficult ;))
In the current JOGL source base GLJPanel can be subclassed. You can get the current code with
cvs -d :pserver:guest@cvs.dev.java.net:/cvs co jogl jogl-demos
The APIs have changed a significant amount since the 1.1.1 release and implement the current state of the JSR-231 specification, which is still under development. The GLJPanel should also be much more robust in the JSR-231 tree than in 1.1.1 so I’d strongly encourage you to switch to the current sources.
Yeah I’m already using JSR-231. My question is how do I create the GLJPanel. I need to specify a GLCapabilities (which is easy enough) a GLCapabilities chooser, and a GLContext to pass into the constructor. However, GLCapabilities is an interface, and I’m not exactly sure how I should specify the chooseCapabilities() method and GLContext is abstract so I don’t know how to get a copy of it.
Thats what my question was about, is not so much can I, but how
You can specify null for any of these arguments. This is made more explicit in the current source base where there are a couple of convenience constructors for each of the GLCanvas and GLJPanel. If explicitly specifying a GLCapabilitiesChooser, you can use a DefaultGLCapabilitiesChooser or write your own.
If i specify the GL Context as null then, how does a GL context get in there? Wouldn’t these things not work without a GLCanvas?
Never mind I’m stupid. I get it and its legit to just do new GLJPanel() now. When you said just use JSR-231 beta I thought I was okay since I had that, but I had an out of date set of docs and I forget that you guys update this like every day. So this current problem is solved, though I imagine I’ll have another question shortly.