After switching from jsr-231-2.0-beta10 build (from Kenai) to a later build (tested back to 10-June) I get
javax.media.opengl.GLException: Not a GL2ES1 implementation when running my application. I had to update some package references for GLUT and KeyEvent (now in com.jogamp) but everything at least compiled fine. Added code to query that glprofile and glcontext really is GL2ES1 and they return true. When calling glContext.getGL().getGL2ES1(); I get the exception. I create my glcontext this way, two parts in different subclasses in order to support multiple profiles - I have substituted some fields to make it more readable (eg the GLProfile.GL2) Part 1: GLProfile glp = GLProfile.get(GLProfile.GL2); AWTGraphicsScreen screen = (AWTGraphicsScreen)AWTGraphicsScreen.createDefault(); AWTGraphicsConfiguration config = (AWTGraphicsConfiguration) GraphicsConfigurationFactory.getFactory(AWTGraphicsDevice.class). chooseGraphicsConfiguration(new GLCapabilities(glp), null, screen); GLCanvas glCanvas = new GLCanvas(config); glCanvas.setSize(width, height); Part 2, gets the glCanvas + some app config params. NativeWindow win = NativeWindowFactory.getNativeWindow(glCanvas, glCanvas.getAWTConfig()); win.getGraphicsConfiguration().getNativeGraphicsConfiguration().getChosenCapabilities(); GLProfile profile = GLProfile.get(GLProfile.GL2); glDrawable = GLDrawableFactory.getFactory(profile).createGLDrawable(win); GLContext context = glDrawable.createContext(null); glCanvas.setGLDrawable(glDrawable); Is there any obvious fault with how I am setting up GL? ps - Use the AWT stuff because we need to drive rendering by our own and not the autodrawable. ds Best regards Richard Sahlin |
Administrator
|
Why don't you use GLProfile profile = GLProfile.getDefault()?
This exception only means that the GL instance is not a GL2ES1 implementation, maybe GL2ES2. Do you know what implementation is returned without your modifications?
Julien Gouesse | Personal blog | Website
|
Administrator
|
In reply to this post by Richard Sahlin
On Thursday, September 23, 2010 13:49:09 Richard Sahlin [via jogamp] wrote:
> > After switching from jsr-231-2.0-beta10 build (from Kenai) to a later build > (tested back to 10-June) I get > javax.media.opengl.GLException: Not a GL2ES1 implementation when running my > application. > I had to update some package references for GLUT and KeyEvent (now in > com.jogamp) but everything at least compiled fine. > Added code to query that glprofile and glcontext really is GL2ES1 and they > return true. > > When calling glContext.getGL().getGL2ES1(); I get the exception. Sure, a GL2 profile is also GL2ES1 and GL2ES2, it's super-interfaces. Please send the exception, whole stack trace and the usual information, build .. ie file url, date, best: hudson build/git ref :) ~Sven > > I create my glcontext this way, two parts in different subclasses in order > to support multiple profiles - I have substituted some fields to make it > more readable (eg the GLProfile.GL2) > > Part 1: > > GLProfile glp = GLProfile.get(GLProfile.GL2); > AWTGraphicsScreen screen = > (AWTGraphicsScreen)AWTGraphicsScreen.createDefault(); > AWTGraphicsConfiguration config = (AWTGraphicsConfiguration) > GraphicsConfigurationFactory.getFactory(AWTGraphicsDevice.class). > chooseGraphicsConfiguration(new GLCapabilities(glp), null, screen); > GLCanvas glCanvas = new GLCanvas(config); > glCanvas.setSize(width, height); > > Part 2, gets the glCanvas + some app config params. > > NativeWindow win = NativeWindowFactory.getNativeWindow(glCanvas, > glCanvas.getAWTConfig()); > > win.getGraphicsConfiguration().getNativeGraphicsConfiguration().getChosenCapabilities(); > GLProfile profile = GLProfile.get(GLProfile.GL2); > glDrawable = > GLDrawableFactory.getFactory(profile).createGLDrawable(win); > GLContext context = glDrawable.createContext(null); > glCanvas.setGLDrawable(glDrawable); > > Is there any obvious fault with how I am setting up GL? > ps - Use the AWT stuff because we need to drive rendering by our own and not > the autodrawable. > ds > Best regards > Richard Sahlin > > > > > ______________________________________ > View message @ http://jogamp.762907.n3.nabble.com/javax-media-opengl-GLException-Not-a-GL2ES1-implementation-tp1567521p1567521.html > To start a new topic under jogamp, email [hidden email] > To unsubscribe from jogamp, click http://jogamp.762907.n3.nabble.com/template/TplServlet.jtp?tpl=unsubscribe_by_code&node=762907&code=c2dvdGhlbEBqYXVzb2Z0LmNvbXw3NjI5MDd8NDU1NjU4MjUx > -- health & wealth mailto:[hidden email] ; http://jausoft.com land : +49 (471) 4707742 ; cell: +49 (151) 28145941 Timezone CET: PST+9, EST+6, UTC+1 |
Hi and thanks for the reply.
Here is the stacktrace: Exception in thread "main" javax.media.opengl.GLException: Not a GL2ES1 implementation at com.jogamp.opengl.impl.gl4.GL4bcImpl.getGL2ES1(GL4bcImpl.java:24652) If I explicitly cast the profile with gles1 = (GL2ES1) glContext.getGL(); there is a nullpointer exception when accessing gles1, eg when setting the hint: Exception in thread "main" java.lang.NullPointerException at com.jogamp.opengl.impl.gl4.GL4bcImpl.glHint(GL4bcImpl.java:9414) The build I use in the stacktrace is this one, I tested several later builds and get the same result. http://jogamp.org/deployment/archive/jogl-b136-2010-06-10_15-40-25/build/jogl-2.0-pre-20100611-linux-i586.zip Best regards /Richard |
Hi
I don't know if this matters but the machine in running on has Ubuntu 8.10 /Richard |
Administrator
|
This post was updated on .
I use Mandriva Linux 2010 and it works correctly. Why do you expect to get a GL2ES1 implementation on a desktop computer?
Julien Gouesse | Personal blog | Website
|
Administrator
|
In reply to this post by Richard Sahlin
On Cent OS 5.3, I do this:
// get the profile GLProfile profile = GLProfile.getDefault(); // this allows us to set particular properties for the GLCanvas GLCapabilities glCapabilities = new GLCapabilities(profile); ... final GL2 gl = GLContext.getCurrentGL().getGL2(); final GL2ES1 gl2es1 = GLContext.getCurrentGL().getGL2ES1(); and it works fine, gl2es1 is not null. I use the latest build.
Julien Gouesse | Personal blog | Website
|
In reply to this post by gouessej
Hi
Because of http://michael-bien.com/mbien/tags/opengl It is the intersection of the desktop GL2/3 and the ES profiles. /Richard |
Administrator
|
Ok so what is wrong for you currently? My GL implementation is a GL4bcImpl like you.
Julien Gouesse | Personal blog | Website
|
In reply to this post by Richard Sahlin
Hi
Now trying to get it running on Win XP with latest aggregated build (pre20100924) I have tried the setup that you mentioned, though I don't know if you create the GLDrawable as I do (see above) It seems that the best I can get is this (other alternative gives nullpointer exception when accessing gles1 or NotGL2ES1implementation error) Exception in thread "main" javax.media.nativewindow.NativeWindowException: Unable to lock surface at com.jogamp.nativewindow.impl.jawt.windows.WindowsJAWTWindow.lockSurfaceImpl(WindowsJAWTWindow.java:80) at com.jogamp.nativewindow.impl.jawt.JAWTWindow.lockSurface(JAWTWindow.java:112) at com.jogamp.opengl.impl.GLDrawableImpl.lockSurface(GLDrawableImpl.java:173) at com.jogamp.opengl.impl.GLContextImpl.makeCurrentLocking(GLContextImpl.java:352) at com.jogamp.opengl.impl.GLContextImpl.makeCurrent(GLContextImpl.java:314) with the following init: NativeWindow win = NativeWindowFactory.getNativeWindow(glCanvas, glCanvas.getAWTConfig()); GLProfile profile = GLProfile.getDefault(); GLDrawable glDrawable = GLDrawableFactory.getFactory(profile).createGLDrawable(win); context = glDrawable.createContext(null); glCanvas.setGLDrawable(glDrawable); <snip> context.makeCurrent(); //This will give the unable to lock surface exception The GLCanvas is created before the init as follows: GLProfile glp = GLProfile.getDefault(); AWTGraphicsScreen screen = (AWTGraphicsScreen)AWTGraphicsScreen.createDefault(); AWTGraphicsConfiguration config = (AWTGraphicsConfiguration) GraphicsConfigurationFactory.getFactory(AWTGraphicsDevice.class).chooseGraphicsConfiguration(new GLCapabilities(glp), null, screen); GLCanvas glCanvas = new GLCanvas(config); Is the problem perhaps related to the way I create the GLCanvas or how I get the NativeWIndow? Any help would be greatly appreciated - we need to use both GLES1 and GLES2 on desktop since we are building a toolchain for our Mobile software suit and want to run the same code (all GLES specifics are abstracted to porting classes) an both desktop and mobile. This is really the only obstacle that prevents us from having a unified dev environment. Regards /Richard |
After doing some investigation of the 'unable to lock surface' error it seems that I had a timing problem, I fixed this and now I am able to get a working GL2ES2 instance!
/Richard |
Administrator
|
How did you solve your problem?
Julien Gouesse | Personal blog | Website
|
Free forum by Nabble | Edit this page |