Class WGLARBBufferRegion

java.lang.Object
org.lwjgl.opengl.WGLARBBufferRegion

public class WGLARBBufferRegion extends Object
Native bindings to the WGL_ARB_buffer_region extension.

The buffer region extension is a mechanism that allows an area of an OpenGL window to be saved in off-screen memory for quick restores. The off-screen memory can either be frame buffer memory or system memory, although frame buffer memory might offer optimal performance.

A buffer region can be created for the front color, back color, depth, and/or stencil buffer. Multiple buffer regions for the same buffer type can exist.

  • Field Details

  • Method Details

    • wglCreateBufferRegionARB

      public static long wglCreateBufferRegionARB(long hdc, int layerPlane, int type)
      Creates a buffer region and returns a handle associated with it.
      Parameters:
      hdc - the device context for the device on which the buffer region is created
      layerPlane - the layer plane. Positive values identify overlay planes, negative values identify underlay planes. A value of 0 identifies the main plane.
      type - a bitwise OR of any of the following values indicating which buffers can be saved or restored. Multiple bits can be set and may result in better performance if multiple buffers are saved or restored. One of:
      FRONT_COLOR_BUFFER_BIT_ARBBACK_COLOR_BUFFER_BIT_ARBDEPTH_BUFFER_BIT_ARB
      STENCIL_BUFFER_BIT_ARB
    • wglDeleteBufferRegionARB

      public static void wglDeleteBufferRegionARB(long region)
      Deletes a buffer region.
      Parameters:
      region - a handle to a buffer region previously created with CreateBufferRegionARB.
    • wglSaveBufferRegionARB

      public static boolean wglSaveBufferRegionARB(long region, int x, int y, int width, int height)
      Saves image, depth, and stencil data into the buffer region.

      Data outside the window for the specified rectangle is undefined. The OpenGL coordinate system is used for specifying the rectangle (x and y specify the lower-left corner of the rectangle).

      If an RC is current to the calling thread, a flush will occur before the save operation.

      The saved buffer region area can be freed by calling wglSaveBufferRegionARB with width or height set to a value of 0.

      Parameters:
      region - a handle to a buffer region previously created with CreateBufferRegionARB.
      x - the window x-coordinate for the source rectangle
      y - the window y-coordinate for the source rectangle
      width - the source rectangle width
      height - the source rectangle height
    • wglRestoreBufferRegionARB

      public static boolean wglRestoreBufferRegionARB(long region, int x, int y, int width, int height, int xSrc, int ySrc)
      Restores a previously saved buffer region.
      Parameters:
      region - a handle to a buffer region previously created with CreateBufferRegionARB.
      x - the window x-coordinate for the destination rectangle
      y - the window y-coordinate for the destination rectangle
      width - the destination rectangle width
      height - the destination rectangle height
      xSrc - the buffer region x-coordinate for the source of the data
      ySrc - the buffer region y-coordinate for the source of the data