Class WGLARBMakeCurrentRead

java.lang.Object
org.lwjgl.opengl.WGLARBMakeCurrentRead

public class WGLARBMakeCurrentRead extends Object
Native bindings to the WGL_ARB_make_current_read extension.

The association of a separate "read" and "draw" DC with the current context allows for preprocessing of image data in an "off screen" DC which is then read into a visible DC for final display.

Requires WGL_ARB_extensions_string.

  • Field Details

  • Method Details

    • wglMakeContextCurrentARB

      public static boolean wglMakeContextCurrentARB(long drawDC, long readDC, long hglrc)
      Associates the context hglrc with the device drawDC for draws and the device readDC for reads. All subsequent OpenGL calls made by the calling thread are drawn on the device identified by drawDC and read on the device identified by readDC.

      The drawDC and readDC parameters must refer to drawing surfaces supported by OpenGL. These parameters need not be the same hdc that was passed to CreateContext when hglrc was created. drawDC must have the same pixel format and be created on the same physical device as the hdc that was passed into wglCreateContext. readDC must be created on the same device as the hdc that was passed to wglCreateContext and it must support the same pixel type as the pixel format of the hdc that was passed to wglCreateContext.

      If wglMakeContextCurrentARB is used to associate a different device for reads than for draws, the "read" device will be used for the following OpenGL operations:

      1. Any pixel data that are sourced based on the value of READ_BUFFER. Note, that accumulation operations use the value of READ_BUFFER, but are not allowed when a different device context is used for reads. In this case, the accumulation operation will generate INVALID_OPERATION.
      2. Any depth values that are retrieved by ReadPixels, CopyPixels, or any OpenGL extension that sources depth images from the frame buffer in the manner of ReadPixels and CopyPixels.
      3. Any stencil values that are retrieved by ReadPixels, CopyPixels, or any OpenGL extension that sources stencil images from the framebuffer in the manner of ReadPixels and CopyPixels.

      These frame buffer values are taken from the surface associated with the device context specified by readDC.

      Parameters:
      drawDC - the "draw" device context
      readDC - the "read" device context
      hglrc - the OpenGL context
    • wglGetCurrentReadDCARB

      public static long wglGetCurrentReadDCARB()
      Returns the "read" device context for the current OpenGL context.