Re: OpenGL 4 status
Posted by
Michael Bien on
May 21, 2011; 11:04pm
URL: https://forum.jogamp.org/OpenGL-4-status-tp2969055p2970435.html
ok so you did it right. looks like a bug to me. If you explicitly
request GL4 you should get it or it should fail much earlier.
the funny part is actually that it is a GL4bc implementation (see
the stack trace). So it should be GL4 with fixed function
functionality (backwards compatibility).
for a workaround you can just cast it down:
GL4 gl = (GL4)drawable.getGL();
(btw context.toString() should give you lots of output which is
quite useful for debugging).
i can't test it right now myself.
best regards,
michael
On 05/22/2011 12:37 AM, Job Zwiers [via jogamp] wrote:
Hi,
Yes, your pages are very useful. But I think that my simple test
is much like your examples, except that I went for OGL4, rather
than OGL3. (And with GL3 instead of GL4 everything works fine)
The relevant code sections:
private GLCanvas createGLCanvas() {
GLProfile glp = GLProfile.get(GLProfile.GL4);
GLCapabilities caps = new GLCapabilities(glp);
GLCanvas canvas = new GLCanvas(caps);
canvas.addGLEventListener(this);
....
public void init(GLAutoDrawable drawable) {
GL4 gl = drawable.getGL().getGL4(); // <===============
THIS LINE THROWS THE EXCEPTION
String version = gl.glGetString(GL4.GL_VERSION);
String shaderversion =
gl.glGetString(GL4.GL_SHADING_LANGUAGE_VERSION);
System.out.println("GLVERSION: " + version + " shading
language: " + shaderversion );
.....
The result:
java] Exception in thread "AWT-EventQueue-0"
javax.media.opengl.GLException: Not a GL4 implementation
[java] at
jogamp.opengl.gl4.GL4bcImpl.getGL4(GL4bcImpl.java:32456)
[java] at firstopengl.OGL4Test.init(OGL4Test.java:173)
[java] at
jogamp.opengl.GLDrawableHelper.init(GLDrawableHelper.java:132)
[java] at
jogamp.opengl.GLDrawableHelper.init(GLDrawableHelper.java:151)
[java] at
javax.media.opengl.awt.GLCanvas$InitAction.run(GLCanvas.java:872)
[java] at
jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:328)
[java] at
javax.media.opengl.awt.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:785)
[java] at
javax.media.opengl.awt.GLCanvas.display(GLCanvas.java:389)
[java] at
javax.media.opengl.awt.GLCanvas.paint(GLCanvas.java:488)
[java] at
sun.awt.RepaintArea.paintComponent(RepaintArea.java:248)
Best regards,
Job
--
- - - -
http://michael-bien.com