Class GLX
- java.lang.Object
-
- org.lwjgl.opengl.GLX
-
public class GLX extends java.lang.Object
Native bindings to GLX.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static class
GLX.Functions
Contains the function pointers loaded fromGL.getFunctionProvider()
.
-
Field Summary
Fields Modifier and Type Field and Description static int
GLX_ACCUM_ALPHA_SIZE
GLX_ACCUM_BLUE_SIZE
GLX_ACCUM_GREEN_SIZE
GLX_ACCUM_RED_SIZE
GLX_ALPHA_SIZE
GLX_AUX_BUFFERSNames for attributes toGetConfig
.static int
GLX_BAD_ATTRIBUTE
GLX_BAD_CONTEXT
GLX_BAD_ENUM
GLX_BAD_SCREEN
GLX_BAD_VALUE
GLX_BAD_VISUALError return values fromGetConfig
.static int
GLX_BLUE_SIZE
GLX_BUFFER_SIZE
GLX_DEPTH_SIZE
GLX_DOUBLEBUFFER
GLX_GREEN_SIZE
GLX_LEVELNames for attributes toGetConfig
.static int
GLX_NO_EXTENSION
Error return values fromGetConfig
.static int
GLX_RED_SIZE
GLX_RGBA
GLX_STENCIL_SIZE
GLX_STEREO
GLX_USE_GLNames for attributes toGetConfig
.static int
GLXBadContext
GLXBadContextState
GLXBadContextTag
GLXBadCurrentDrawable
GLXBadCurrentWindow
GLXBadDrawable
GLXBadFBConfig
GLXBadLargeRequest
GLXBadPbuffer
GLXBadPixmap
GLXBadRenderRequest
GLXBadWindow
GLXUnsupportedPrivateRequestErrors.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static org.lwjgl.system.linux.XVisualInfo
glXChooseVisual(long display, int screen, int[] attrib_list)
Array version of:ChooseVisual
static org.lwjgl.system.linux.XVisualInfo
glXChooseVisual(long display, int screen, java.nio.IntBuffer attrib_list)
Finds a visual that matches the client’s specified attributes.static void
glXCopyContext(long display, long source, long dest, long mask)
Copies OpenGL rendering state from one context to another.static long
glXCreateContext(long display, org.lwjgl.system.linux.XVisualInfo visual, long share_list, int direct)
Creates an OpenGL context.static long
glXCreateGLXPixmap(long display, org.lwjgl.system.linux.XVisualInfo visual, long pixmap)
Creates a GLXPixmap from a Pixmap.static void
glXDestroyContext(long display, long ctx)
Destroys an OpenGL context.static void
glXDestroyGLXPixmap(long display, long pixmap)
Destroys a GLXPixmap.static int
glXGetConfig(long display, org.lwjgl.system.linux.XVisualInfo visual, int attribute, int[] value)
Array version of:GetConfig
static int
glXGetConfig(long display, org.lwjgl.system.linux.XVisualInfo visual, int attribute, java.nio.IntBuffer value)
Returns a description of an OpenGL attribute exported by a Visual.static long
glXGetCurrentContext()
Returns the GLXContext that is current in the current thread.static long
glXGetCurrentDrawable()
Returns the XID of the current drawable used for rendering.static int
glXIsDirect(long display, long ctx)
Determines if an OpenGL rendering context is direct.static int
glXMakeCurrent(long display, long draw, long ctx)
Makes a context current in the current threadstatic int
glXQueryExtension(long display, int[] error_base, int[] event_base)
Array version of:QueryExtension
static int
glXQueryExtension(long display, java.nio.IntBuffer error_base, java.nio.IntBuffer event_base)
Ascertains if the GLX extension is defined for an X server.static int
glXQueryVersion(long display, int[] major, int[] minor)
Array version of:QueryVersion
static int
glXQueryVersion(long display, java.nio.IntBuffer major, java.nio.IntBuffer minor)
Queries the GLX version supported.static void
glXSwapBuffers(long display, long draw)
For drawables that are double buffered, makes the contexts of the back buffer potentially visible (i.e., become the contents of the front buffer).static void
glXUseXFont(long font, int first, int count, int list_base)
Provides a shortcut for using X fonts.static void
glXWaitGL()
Prevents X requests from executing until any outstanding OpenGL rendering is done.static void
glXWaitX()
Prevents the OpenGL command sequence from executing until any outstanding X requests are completed.
-
-
-
Field Detail
-
GLXBadContext, GLXBadContextState, GLXBadDrawable, GLXBadPixmap, GLXBadContextTag, GLXBadCurrentWindow, GLXBadRenderRequest, GLXBadLargeRequest, GLXUnsupportedPrivateRequest, GLXBadFBConfig, GLXBadPbuffer, GLXBadCurrentDrawable, GLXBadWindow
Errors.
-
GLX_USE_GL, GLX_BUFFER_SIZE, GLX_LEVEL, GLX_RGBA, GLX_DOUBLEBUFFER, GLX_STEREO, GLX_AUX_BUFFERS, GLX_RED_SIZE, GLX_GREEN_SIZE, GLX_BLUE_SIZE, GLX_ALPHA_SIZE, GLX_DEPTH_SIZE, GLX_STENCIL_SIZE, GLX_ACCUM_RED_SIZE, GLX_ACCUM_GREEN_SIZE, GLX_ACCUM_BLUE_SIZE, GLX_ACCUM_ALPHA_SIZE
Names for attributes toGetConfig
.
-
GLX_BAD_SCREEN, GLX_BAD_ATTRIBUTE, GLX_NO_EXTENSION, GLX_BAD_VISUAL, GLX_BAD_CONTEXT, GLX_BAD_VALUE, GLX_BAD_ENUM
Error return values fromGetConfig
. Success is indicated by a value of 0.
-
-
Method Detail
-
glXQueryExtension
public static int glXQueryExtension(long display, java.nio.IntBuffer error_base, java.nio.IntBuffer event_base)
Ascertains if the GLX extension is defined for an X server.- Parameters:
display
- the connection to the X servererror_base
- returns the value of the first error codeevent_base
- returns the value of the first event code
-
glXQueryVersion
public static int glXQueryVersion(long display, java.nio.IntBuffer major, java.nio.IntBuffer minor)
Queries the GLX version supported.- Parameters:
display
- the connection to the X servermajor
- returns the major versionminor
- returns the minor version
-
glXGetConfig
public static int glXGetConfig(long display, org.lwjgl.system.linux.XVisualInfo visual, int attribute, java.nio.IntBuffer value)
Returns a description of an OpenGL attribute exported by a Visual.- Parameters:
display
- the connection to the X servervisual
- a pointer to anXVisualInfo
structureattribute
- the attribute to queryvalue
- returns the attribute value
-
glXChooseVisual
public static org.lwjgl.system.linux.XVisualInfo glXChooseVisual(long display, int screen, java.nio.IntBuffer attrib_list)
Finds a visual that matches the client’s specified attributes.- Parameters:
display
- the connection to the X serverscreen
- the screen numberattrib_list
- a list of attributes terminated withNone
- Returns:
- a pointer to an
XVisualInfo
structure describing the visual that best matches the specified attributes. If no matching visual exists,NULL
is returned.
-
glXCreateContext
public static long glXCreateContext(long display, org.lwjgl.system.linux.XVisualInfo visual, long share_list, int direct)
Creates an OpenGL context.- Parameters:
display
- the connection to the X servervisual
- a pointer to anXVisualInfo
structureshare_list
- the GLXContext to share objects withdirect
- whether direct rendering is requested
-
glXMakeCurrent
public static int glXMakeCurrent(long display, long draw, long ctx)
Makes a context current in the current thread- Parameters:
display
- the connection to the X serverdraw
- the draw GLXdrawablectx
- the GLXContext to make current
-
glXCopyContext
public static void glXCopyContext(long display, long source, long dest, long mask)
Copies OpenGL rendering state from one context to another.- Parameters:
display
- the connection to the X serversource
- the source GLXContextdest
- the destination GLXContextmask
- indicates which groups of state variables are to be copied; it contains the bitwise OR of the symbolic names for the attribute groups
-
glXIsDirect
public static int glXIsDirect(long display, long ctx)
Determines if an OpenGL rendering context is direct.- Parameters:
display
- the connection to the X serverctx
- the GLXContext to query
-
glXDestroyContext
public static void glXDestroyContext(long display, long ctx)
Destroys an OpenGL context.If
ctx
is still current to any thread,ctx
is not destroyed until it is no longer current. In any event, the associated XID will be destroyed andctx
cannot subsequently be made current to any thread.- Parameters:
display
- the connection to the X serverctx
- the GLXContext to destroy
-
glXGetCurrentContext
public static long glXGetCurrentContext()
Returns the GLXContext that is current in the current thread.
-
glXGetCurrentDrawable
public static long glXGetCurrentDrawable()
Returns the XID of the current drawable used for rendering.
-
glXWaitGL
public static void glXWaitGL()
Prevents X requests from executing until any outstanding OpenGL rendering is done.OpenGL calls made prior to
glXWaitGL
are guaranteed to be executed before X rendering calls made afterglXWaitGL
. While the same result can be achieved usingFinish
,glXWaitGL
does not require a round trip to the server, and is therefore more efficient in cases where the client and server are on separate machines.
-
glXWaitX
public static void glXWaitX()
Prevents the OpenGL command sequence from executing until any outstanding X requests are completed.X rendering calls made prior to
glXWaitX
are guaranteed to be executed before OpenGL rendering calls made afterglXWaitX
. While the same result can be achieved usingXSync()
,glXWaitX
does not require a round trip to the server, and may therefore be more efficient.
-
glXSwapBuffers
public static void glXSwapBuffers(long display, long draw)
For drawables that are double buffered, makes the contexts of the back buffer potentially visible (i.e., become the contents of the front buffer).The contents of the back buffer then become undefined. This operation is a no-op if draw was created with a non-double-buffered GLXFBConfig, or if draw is a GLXPixmap.
- Parameters:
display
- the connection to the X serverdraw
- a double buffered GLXDrawable
-
glXUseXFont
public static void glXUseXFont(long font, int first, int count, int list_base)
Provides a shortcut for using X fonts.- Parameters:
font
- the font to usefirst
- the first glyph in the font to usecount
- the number of display lists to definelist_base
- the base list number
-
glXCreateGLXPixmap
public static long glXCreateGLXPixmap(long display, org.lwjgl.system.linux.XVisualInfo visual, long pixmap)
Creates a GLXPixmap from a Pixmap.- Parameters:
display
- the connection to the X servervisual
- a pointer to aXVisualInfo
structurepixmap
- the Pixmap
-
glXDestroyGLXPixmap
public static void glXDestroyGLXPixmap(long display, long pixmap)
Destroys a GLXPixmap.- Parameters:
display
- the connection to the X serverpixmap
- the GLXPixmap to destroy.
-
glXQueryExtension
public static int glXQueryExtension(long display, int[] error_base, int[] event_base)
Array version of:QueryExtension
-
glXQueryVersion
public static int glXQueryVersion(long display, int[] major, int[] minor)
Array version of:QueryVersion
-
glXGetConfig
public static int glXGetConfig(long display, org.lwjgl.system.linux.XVisualInfo visual, int attribute, int[] value)
Array version of:GetConfig
-
glXChooseVisual
public static org.lwjgl.system.linux.XVisualInfo glXChooseVisual(long display, int screen, int[] attrib_list)
Array version of:ChooseVisual
-
-