Class GLX

java.lang.Object
org.lwjgl.opengl.GLX
Direct Known Subclasses:
GLX11

public class GLX extends Object
Native bindings to GLX.
  • Field Details

  • Method Details

    • nglXQueryExtension

      public static int nglXQueryExtension(long display, long error_base, long event_base)
      Unsafe version of: QueryExtension
    • glXQueryExtension

      public static boolean glXQueryExtension(long display, IntBuffer error_base, IntBuffer event_base)
      Ascertains if the GLX extension is defined for an X server.
      Parameters:
      display - the connection to the X server
      error_base - returns the value of the first error code
      event_base - returns the value of the first event code
    • nglXQueryVersion

      public static int nglXQueryVersion(long display, long major, long minor)
      Unsafe version of: QueryVersion
    • glXQueryVersion

      public static boolean glXQueryVersion(long display, IntBuffer major, IntBuffer minor)
      Queries the GLX version supported.
      Parameters:
      display - the connection to the X server
      major - returns the major version
      minor - returns the minor version
    • nglXGetConfig

      public static int nglXGetConfig(long display, long visual, int attribute, long value)
      Unsafe version of: GetConfig
    • glXGetConfig

      public static int glXGetConfig(long display, XVisualInfo visual, int attribute, IntBuffer value)
      Returns a description of an OpenGL attribute exported by a Visual.
      Parameters:
      display - the connection to the X server
      visual - a pointer to an XVisualInfo structure
      attribute - the attribute to query
      value - returns the attribute value
    • nglXChooseVisual

      public static long nglXChooseVisual(long display, int screen, long attrib_list)
      Unsafe version of: ChooseVisual
    • glXChooseVisual

      @Nullable public static XVisualInfo glXChooseVisual(long display, int screen, @Nullable IntBuffer attrib_list)
      Finds a visual that matches the client’s specified attributes.
      Parameters:
      display - the connection to the X server
      screen - the screen number
      attrib_list - a list of attributes terminated with None
      Returns:
      a pointer to an XVisualInfo structure describing the visual that best matches the specified attributes. If no matching visual exists, NULL is returned.
    • nglXCreateContext

      public static long nglXCreateContext(long display, long visual, long share_list, int direct)
      Unsafe version of: CreateContext
    • glXCreateContext

      public static long glXCreateContext(long display, XVisualInfo visual, long share_list, boolean direct)
      Creates an OpenGL context.
      Parameters:
      display - the connection to the X server
      visual - a pointer to an XVisualInfo structure
      share_list - the GLXContext to share objects with
      direct - whether direct rendering is requested
    • glXMakeCurrent

      public static boolean glXMakeCurrent(long display, long draw, long ctx)
      Makes a context current in the current thread
      Parameters:
      display - the connection to the X server
      draw - the draw GLXdrawable
      ctx - 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 server
      source - the source GLXContext
      dest - the destination GLXContext
      mask - 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 boolean glXIsDirect(long display, long ctx)
      Determines if an OpenGL rendering context is direct.
      Parameters:
      display - the connection to the X server
      ctx - 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 and ctx cannot subsequently be made current to any thread.

      Parameters:
      display - the connection to the X server
      ctx - 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 after glXWaitGL. While the same result can be achieved using Finish, 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 after glXWaitX. While the same result can be achieved using XSync(), 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 server
      draw - 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 use
      first - the first glyph in the font to use
      count - the number of display lists to define
      list_base - the base list number
    • nglXCreateGLXPixmap

      public static long nglXCreateGLXPixmap(long display, long visual, long pixmap)
      Unsafe version of: CreateGLXPixmap
    • glXCreateGLXPixmap

      public static long glXCreateGLXPixmap(long display, XVisualInfo visual, long pixmap)
      Creates a GLXPixmap from a Pixmap.
      Parameters:
      display - the connection to the X server
      visual - a pointer to a XVisualInfo structure
      pixmap - the Pixmap
    • glXDestroyGLXPixmap

      public static void glXDestroyGLXPixmap(long display, long pixmap)
      Destroys a GLXPixmap.
      Parameters:
      display - the connection to the X server
      pixmap - the GLXPixmap to destroy.
    • glXQueryExtension

      public static boolean glXQueryExtension(long display, int[] error_base, int[] event_base)
      Array version of: QueryExtension
    • glXQueryVersion

      public static boolean glXQueryVersion(long display, int[] major, int[] minor)
      Array version of: QueryVersion
    • glXGetConfig

      public static int glXGetConfig(long display, XVisualInfo visual, int attribute, int[] value)
      Array version of: GetConfig
    • glXChooseVisual

      @Nullable public static XVisualInfo glXChooseVisual(long display, int screen, @Nullable int[] attrib_list)
      Array version of: ChooseVisual