public abstract class SlickCallable
extends java.lang.Object
SlickCallable callable = new SlickCallable() {
public performGLOperations() throws SlickException {
GL.glTranslate(0,0,1);
glBegin(GL.GL_POLYGONS);
glVertex(..);
...
glEnd();
}
}
callable.call();
Alternatively you can use the static methods directly
SlickCallable.enterSafeBlock();
GL.glTranslate(0,0,1);
glBegin(GL.GL_POLYGONS);
glVertex(..);
...
glEnd();
SlickCallable.leaveSafeBlock();
| Constructor and Description |
|---|
SlickCallable() |
| Modifier and Type | Method and Description |
|---|---|
void |
call()
Cause this callable to perform it's GL operations (@see performGLOperations()).
|
static void |
enterSafeBlock()
Enter a safe block ensuring that all the OpenGL state that slick
uses is safe before touching the GL state directly.
|
static void |
leaveSafeBlock()
Leave a safe block ensuring that all of Slick's OpenGL state is
restored since the last enter.
|
protected abstract void |
performGLOperations()
Perform the GL operations that this callable is intended to.
|
public static void enterSafeBlock()
public static void leaveSafeBlock()
public final void call()
throws SlickException
SlickException - Indicates a failure while performing the GL operations or
maintaing SlickStateprotected abstract void performGLOperations()
throws SlickException
SlickException - Indicates a failure of some sort. This is user exception