Package org.lwjgl.opengl
Class SharedDrawable
java.lang.Object
org.lwjgl.opengl.SharedDrawable
- All Implemented Interfaces:
Drawable
A Drawable implementation that shares its context with another Drawable. This is useful
for background loading of resources. See org.lwjgl.test.opengl.multithread.BackgroundLoad
for an example.
- Author:
- Spasi
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.lwjgl.opengl.ContextGLThe OpenGL Context.protected org.lwjgl.opengl.PeerInfoHandle to the native GL rendering contextprotected PixelFormatThe PixelFormat used to create the drawable. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected final voidvoidorg.lwjgl.opengl.ContextGLvoiddestroy()Destroys the Drawable.org.lwjgl.opengl.ContextGLvoidinitContext(float r, float g, float b) booleanReturns true if the Drawable's context is current in the current thread.voidMakes the Drawable's context current in the current thread.voidIf the Drawable's context is current in the current thread, no context will be current after a call to this method.voidsetCLSharingProperties(PointerBuffer properties) Sets the appropriate khr_gl_sharing properties in the targetPointerBuffer, so that if it is used in aclCreateContext(FromType)call, the created CL context will be sharing objects with thisDrawable's GL context.voidvoidsetPixelFormat(PixelFormatLWJGL pf, ContextAttribs attribs) voidsetSwapInterval(int swap_interval) void
-
Field Details
-
pixel_format
The PixelFormat used to create the drawable. -
peer_info
protected org.lwjgl.opengl.PeerInfo peer_infoHandle to the native GL rendering context -
context
protected org.lwjgl.opengl.ContextGL contextThe OpenGL Context.
-
-
Constructor Details
-
SharedDrawable
- Throws:
LWJGLException
-
-
Method Details
-
setPixelFormat
- Throws:
LWJGLException
-
setPixelFormat
- Throws:
LWJGLException
-
getPixelFormat
-
getContext
public org.lwjgl.opengl.ContextGL getContext() -
checkGLError
public void checkGLError() -
setSwapInterval
public void setSwapInterval(int swap_interval) -
swapBuffers
- Throws:
LWJGLException
-
initContext
public void initContext(float r, float g, float b) -
isCurrent
Description copied from interface:DrawableReturns true if the Drawable's context is current in the current thread.- Specified by:
isCurrentin interfaceDrawable- Throws:
LWJGLException
-
makeCurrent
Description copied from interface:DrawableMakes the Drawable's context current in the current thread.- Specified by:
makeCurrentin interfaceDrawable- Throws:
LWJGLException
-
releaseContext
Description copied from interface:DrawableIf the Drawable's context is current in the current thread, no context will be current after a call to this method.- Specified by:
releaseContextin interfaceDrawable- Throws:
LWJGLException
-
destroy
public void destroy()Description copied from interface:DrawableDestroys the Drawable. -
setCLSharingProperties
Description copied from interface:DrawableSets the appropriate khr_gl_sharing properties in the targetPointerBuffer, so that if it is used in aclCreateContext(FromType)call, the created CL context will be sharing objects with thisDrawable's GL context. After a call to this method, the target buffer position will have advanced by 2 to 4 positions, depending on the implementation.- Specified by:
setCLSharingPropertiesin interfaceDrawable- Parameters:
properties- The target properties buffer. It must have at least 4 positions remaining.- Throws:
LWJGLException
-
checkDestroyed
protected final void checkDestroyed()