Hey, I would like to use JOGL without an event listener, somewhere along the lines of obtaining the GLContext and invoking commands to its instance of GL, could anyone help me with this?
incase you need it made any clearer, here is an example:
int result = context.makeCurrent();
switch (result) {
case GLContext.CONTEXT_NOT_CURRENT:
System.err.println("Couldn't obtain GLContext");
break;
default:
// draw to context.getGL()
break;
}
context.release();
Hi
The book “Pro Java 6 3D game development” shows how this could be done. You can probably google on “Active rendering” and find
some more information about this.
The code in the book is rather old, so i guess you have to replace the code that initialize the rendering canvas with something like this:
thanks, i solved it before although this is basically what i had
but now for some reason java is throwing an exception:
Exception in thread "Thread-3" java.lang.RuntimeException: Unable to initialize JAWT
at com.sun.nativewindow.impl.jawt.JAWT$1.run(JAWT.java:100)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.nativewindow.impl.jawt.JAWT.getJAWT(JAWT.java:95)
at com.sun.nativewindow.impl.jawt.windows.WindowsJAWTWindow.lockSurface(WindowsJAWTWindow.java:69)
at com.sun.opengl.impl.GLDrawableImpl.lockSurface(GLDrawableImpl.java:130)
at com.sun.opengl.impl.windows.wgl.WindowsWGLDrawable.setRealized(WindowsWGLDrawable.java:70)
at org.peehpee.gl.ui.Canvas3D.run(Canvas3D.java:66)
at java.lang.Thread.run(Unknown Source)