public final class GLContext
extends java.lang.Object
Constructor and Description |
---|
GLContext() |
Modifier and Type | Method and Description |
---|---|
static ContextCapabilities |
getCapabilities()
Get the current capabilities instance.
|
static void |
loadOpenGLLibrary()
If the OpenGL reference count is 0, the library is loaded.
|
static void |
unloadOpenGLLibrary()
The OpenGL library reference count is decremented, and if it reaches 0, the library is unloaded.
|
static void |
useContext(java.lang.Object context)
Makes a GL context the current LWJGL context by loading GL function pointers.
|
static void |
useContext(java.lang.Object context,
boolean forwardCompatible)
Makes a GL context the current LWJGL context by loading GL function pointers.
|
public static ContextCapabilities getCapabilities()
public static void useContext(java.lang.Object context) throws LWJGLException
If the context is the same as last time, then this is a no-op.
If the context has not been encountered before it will be fully initialized from scratch. Otherwise a cached set of caps and function pointers will be used.
The reference to the context is held in a weak reference; therefore if no strong reference exists to the GL context it will automatically be forgotten by the VM at an indeterminate point in the future, freeing up a little RAM.
context
- The context object, which uniquely identifies a GL context. If context is null, the native stubs are
unloaded.LWJGLException
- if context non-null, and the gl library can't be loaded or the basic GL11 functions can't be loadedpublic static void useContext(java.lang.Object context, boolean forwardCompatible) throws LWJGLException
If the context is the same as last time, then this is a no-op.
If the context has not been encountered before it will be fully initialized from scratch. Otherwise a cached set of caps and function pointers will be used.
The reference to the context is held in a weak reference; therefore if no strong reference exists to the GL context it will automatically be forgotten by the VM at an indeterminate point in the future, freeing up a little RAM.
If forwardCompatible is true, function pointers of deprecated GL11-GL21 functionality will not be loaded. Calling a deprecated
function using the specified context will result in an IllegalStateException
.
context
- The context object, which uniquely identifies a GL context. If context is null, the native stubs are
unloaded.forwardCompatible
- If the context is a forward compatible context (does not expose deprecated functionality, see XGL_ARB_create_context)LWJGLException
- if context non-null, and the gl library can't be loaded or the basic GL11 functions can't be loadedpublic static void loadOpenGLLibrary() throws LWJGLException
LWJGLException
public static void unloadOpenGLLibrary()
Copyright © 2002-2009 lwjgl.org. All Rights Reserved.