Context encapsulates an OpenGL context.
This class is thread-safe.
| Modifier and Type | Field and Description |
|---|---|
| private final ContextAttribs | |
| private static final ThreadLocal | current_context_local
The current Context |
| private boolean | |
| private boolean | destroyed
Whether the context has been destroyed |
| private final boolean | |
| private final ByteBuffer | handle
Handle to the native GL rendering context |
| private static final ContextImplementation | implementation
The platform specific implementation of context methods |
| private final PeerInfo | |
| private Thread | thread
The thread that has this context current, or null. |
| Access | Constructor and Description |
|---|---|
| pack-priv | ContextGL(PeerInfo peer_info, ContextAttribs attribs, ContextGL shared_context)
Create a context with the specified peer info and shared context |
| Modifier and Type | Method and Description |
|---|---|
| private boolean | |
| private void | |
| private void | |
| private static ContextImplementation | |
| public synchronized void | |
| public synchronized void | |
| pack-priv ContextAttribs | |
| pack-priv static ContextGL | |
| pack-priv ByteBuffer | |
| pack-priv PeerInfo | |
| public synchronized boolean | |
| public synchronized void | |
| public void | releaseCurrent()
Implements org. |
| public synchronized void | releaseDrawable()
Implements org. |
| public synchronized void | |
| public static void | |
| public static void | |
| public synchronized void |
| contextAttribs | back to summary |
|---|---|
| private final ContextAttribs contextAttribs | |
| current_context_local | back to summary |
|---|---|
| private static final ThreadLocal<ContextGL> current_context_local The current Context | |
| destroy_requested | back to summary |
|---|---|
| private boolean destroy_requested | |
| destroyed | back to summary |
|---|---|
| private boolean destroyed Whether the context has been destroyed | |
| forwardCompatible | back to summary |
|---|---|
| private final boolean forwardCompatible | |
| handle | back to summary |
|---|---|
| private final ByteBuffer handle Handle to the native GL rendering context | |
| implementation | back to summary |
|---|---|
| private static final ContextImplementation implementation The platform specific implementation of context methods | |
| peer_info | back to summary |
|---|---|
| private final PeerInfo peer_info | |
| thread | back to summary |
|---|---|
| private Thread thread The thread that has this context current, or null. | |
| ContextGL | back to summary |
|---|---|
| pack-priv ContextGL(PeerInfo peer_info, ContextAttribs attribs, ContextGL shared_context) throws LWJGLException Create a context with the specified peer info and shared context | |
| canAccess | back to summary |
|---|---|
| private boolean canAccess() | |
| checkAccess | back to summary |
|---|---|
| private void checkAccess() | |
| checkDestroy | back to summary |
|---|---|
| private void checkDestroy() | |
| createImplementation | back to summary |
|---|---|
| private static ContextImplementation createImplementation() | |
| destroy | back to summary |
|---|---|
| public synchronized void destroy() throws LWJGLException Request destruction of the Context. If the context is current, no context will be current after this call. The context is destroyed when no thread has it current. | |
| forceDestroy | back to summary |
|---|---|
| public synchronized void forceDestroy() throws LWJGLException Destroy the context. This method behaves the same as destroy() with the extra requirement that the context must be either current to the current thread or not current at all. | |
| getContextAttribs | back to summary |
|---|---|
| pack-priv ContextAttribs getContextAttribs() | |
| getCurrentContext | back to summary |
|---|---|
| pack-priv static ContextGL getCurrentContext() | |
| getHandle | back to summary |
|---|---|
| pack-priv ByteBuffer getHandle() | |
| getPeerInfo | back to summary |
|---|---|
| pack-priv PeerInfo getPeerInfo() | |
| isCurrent | back to summary |
|---|---|
| public synchronized boolean isCurrent() throws LWJGLException Implements org. Query whether the context is current | |
| makeCurrent | back to summary |
|---|---|
| public synchronized void makeCurrent() throws LWJGLException Implements org. Make the context current | |
| releaseCurrent | back to summary |
|---|---|
| public void releaseCurrent() throws LWJGLException Implements org. Release the current context (if any). After this call, no context is current. | |
| releaseDrawable | back to summary |
|---|---|
| public synchronized void releaseDrawable() throws LWJGLException Implements org. Release the context from its drawable. This is necessary on some platforms, like Mac OS X, where binding the context to a drawable and binding the context for rendering are two distinct actions and where calling releaseDrawable on every releaseCurrentContext results in artifacts. | |
| setCLSharingProperties | back to summary |
|---|---|
| public synchronized void setCLSharingProperties(final PointerBuffer properties) throws LWJGLException | |
| setSwapInterval | back to summary |
|---|---|
| public static void setSwapInterval(int value) Set the buffer swap interval. This call is a best-attempt at changing the monitor swap interval, which is the minimum periodicity of color buffer swaps, measured in video frame periods, and is not guaranteed to be successful. A video frame period is the time required to display a full frame of video data. | |
| swapBuffers | back to summary |
|---|---|
| public static void swapBuffers() throws LWJGLException Swap the buffers on the current context. Only valid for double-buffered contexts | |
| update | back to summary |
|---|---|
| public synchronized void update() Update the context. Should be called whenever it's drawable is moved or resized | |