Posted by
Sven Gothel on
Dec 10, 2011; 3:54pm
URL: https://forum.jogamp.org/What-profile-to-choose-tp3575514p3575561.html
On Saturday, December 10, 2011 04:18:37 PM Jeffg [via jogamp] wrote:
>
> So I'm venturing into JOGL2 from JOGL 1.1.1, but I'm a little confused by the
> Profile thing. I've read Michael Bien's
>
http://michael-bien.com/mbien/entry/jogl_2_opengl_profiles_explained blog
Well .. maybe you like to try the 'original' document:
http://jogamp.org/jogl/doc/Overview-OpenGL-Evolution-And-JOGL.html(He reuses the UML diagram I created)
> post , but I'm still not sure what fits. My main desire with moving to
> JOGL2 is performance and staying on a current framework. I can say that my
> desktop users are running at least OpenGL 2.1 - my minimum requirement as I
> use point sprites. I need to maintain that minimum requirement as some of
> these computers are several years old and unlikely to be updated. Since I'm
> going to have to recode it, I'd like to make it as advanced as possible,
> while still making sure everyone can use it. I have no plans to introduce
> multiple profiles based on the users version - too much work for what I'm
> doing. I also have no plans to support mobile, so any compatibility with
> that would be a bonus but it's not required and I don't want to limit my
> existing functionality.
It all boils down to fixed-function or programmable pipeline,
pls read the doc linked above.
IE. if you desire to run your stuff on mobile and desktop
then you might like to choose:
GL2ES1 for GL2 + ES1 common profile fixed-function pipeline
GL2ES2 for GL2 + ES2 common profile programmable pipeline
Then you can use specifics in your render methods if you desire
by querying the profile, ie. gl.isGL* .. or by quering extensions.
gl.isExtensionAvailable(String glExtensionName)
gl.isGL3()
This is how your create a GL2ES2 compatible profile/caps:
if(!GLProfile.isAvailable(GLProfile.GL2ES2)) {
System.out.println("GLProfile GL2ES2 n/a");
return;
}
GLProfile glp = GLProfile.getGL2ES2();
GLCapabilities caps = new GLCapabilities(glp);
GLWindow glWindow = GLWindow.create(caps);
Assert.assertNotNull(glWindow);
glWindow.setTitle("TestGLProfile01NEWT");
glWindow.addGLEventListener(new DumpGLInfo());
glWindow.setSize(128, 128);
glWindow.setVisible(true);
glWindow.display();
Thread.sleep(100);
glWindow.destroy();
GLProfile will always attempt to use the highest available profile
compatible w/ the desired one, ie GL2ES2.
~Sven