Package org.lwjgl.opengl
Class SharedDrawable
- java.lang.Object
-
- org.lwjgl.opengl.SharedDrawable
-
-
Field Summary
Fields Modifier and Type Field Description protected org.lwjgl.opengl.ContextGLcontextThe OpenGL Context.protected org.lwjgl.opengl.PeerInfopeer_infoHandle to the native GL rendering contextprotected PixelFormatpixel_formatThe PixelFormat used to create the drawable.
-
Constructor Summary
Constructors Constructor Description SharedDrawable(Drawable drawable)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidcheckDestroyed()voidcheckGLError()org.lwjgl.opengl.ContextGLcreateSharedContext()voiddestroy()Destroys the Drawable.org.lwjgl.opengl.ContextGLgetContext()PixelFormatLWJGLgetPixelFormat()voidinitContext(float r, float g, float b)booleanisCurrent()Returns true if the Drawable's context is current in the current thread.voidmakeCurrent()Makes the Drawable's context current in the current thread.voidreleaseContext()If 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.voidsetPixelFormat(PixelFormatLWJGL pf)voidsetPixelFormat(PixelFormatLWJGL pf, ContextAttribs attribs)voidsetSwapInterval(int swap_interval)voidswapBuffers()
-
-
-
Field Detail
-
pixel_format
protected PixelFormat pixel_format
The PixelFormat used to create the drawable.
-
peer_info
protected org.lwjgl.opengl.PeerInfo peer_info
Handle to the native GL rendering context
-
context
protected org.lwjgl.opengl.ContextGL context
The OpenGL Context.
-
-
Constructor Detail
-
SharedDrawable
public SharedDrawable(Drawable drawable) throws LWJGLException
- Throws:
LWJGLException
-
-
Method Detail
-
createSharedContext
public org.lwjgl.opengl.ContextGL createSharedContext()
-
setPixelFormat
public void setPixelFormat(PixelFormatLWJGL pf) throws LWJGLException
- Throws:
LWJGLException
-
setPixelFormat
public void setPixelFormat(PixelFormatLWJGL pf, ContextAttribs attribs) throws LWJGLException
- Throws:
LWJGLException
-
getPixelFormat
public PixelFormatLWJGL getPixelFormat()
-
getContext
public org.lwjgl.opengl.ContextGL getContext()
-
checkGLError
public void checkGLError()
-
setSwapInterval
public void setSwapInterval(int swap_interval)
-
swapBuffers
public void swapBuffers() throws LWJGLException- Throws:
LWJGLException
-
initContext
public void initContext(float r, float g, float b)
-
isCurrent
public boolean isCurrent() throws LWJGLExceptionDescription copied from interface:DrawableReturns true if the Drawable's context is current in the current thread.- Specified by:
isCurrentin interfaceDrawable- Throws:
LWJGLException
-
makeCurrent
public void makeCurrent() throws LWJGLExceptionDescription copied from interface:DrawableMakes the Drawable's context current in the current thread.- Specified by:
makeCurrentin interfaceDrawable- Throws:
LWJGLException
-
releaseContext
public void releaseContext() throws LWJGLExceptionDescription 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
public void setCLSharingProperties(PointerBuffer properties) throws LWJGLException
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()
-
-