All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.lwjgl.opengl.KHRRobustness Maven / Gradle / Ivy

There is a newer version: 3.3.0
Show newest version
/*
 * Copyright LWJGL. All rights reserved.
 * License terms: https://www.lwjgl.org/license
 * MACHINE GENERATED FILE, DO NOT EDIT
 */
package org.lwjgl.opengl;

import java.nio.*;

import org.lwjgl.system.*;

import static org.lwjgl.system.Checks.*;
import static org.lwjgl.system.JNI.*;
import static org.lwjgl.system.MemoryStack.*;
import static org.lwjgl.system.MemoryUtil.*;

/**
 * Native bindings to the KHR_robustness extension.
 * 
 * 

Several recent trends in how OpenGL ES integrates into modern computer systems have created new requirements for robustness and security for GL * rendering contexts.

* *

Additionally GPU architectures now support hardware fault detection; for example, video memory supporting ECC (error correcting codes) and error * detection. GL contexts should be capable of recovering from hardware faults such as uncorrectable memory errors. Along with recovery from such hardware * faults, the recovery mechanism can also allow recovery from video memory access exceptions and system software failures. System software failures can * be due to device changes or driver failures.

* *

GL queries that return (write) some number of bytes to a buffer indicated by a pointer parameter introduce risk of buffer overflows that might be * exploitable by malware. To address this, queries with return value sizes that are not expressed directly by the parameters to the query itself are * given additional API functions with an additional parameter that specifies the number of bytes in the buffer and never writing bytes beyond that limit. * This is particularly useful for multi-threaded usage of GL contexts in a "share group" where one context can change objects in ways that can cause * buffer overflows for another context's GL queries.

* *

The original ARB_vertex_buffer_object extension includes an issue that explicitly states program termination is allowed when out-of-bounds vertex * buffer object fetches occur. Modern graphics hardware is capable of well-defined behavior in the case of out-of- bounds vertex buffer object fetches. * Older hardware may require extra checks to enforce well-defined (and termination free) behavior, but this expense is warranted when processing * potentially untrusted content.

* *

The intent of this extension is to address some specific robustness goals:

* *
    *
  • For all existing GL queries, provide additional "safe" APIs that limit data written to user pointers to a buffer size in bytes that is an explicit * additional parameter of the query.
  • *
  • Provide a mechanism for a GL application to learn about graphics resets that affect the context. When a graphics reset occurs, the GL context * becomes unusable and the application must create a new context to continue operation. Detecting a graphics reset happens through an inexpensive query.
  • *
  • Define behavior of OpenGL calls made after a graphics reset.
  • *
  • Provide an enable to guarantee that out-of-bounds buffer object accesses by the GPU will have deterministic behavior and preclude application * instability or termination due to an incorrect buffer access. Such accesses include vertex buffer fetches of attributes and indices, and indexed * reads of uniforms or parameters from buffers.
  • *
* *

Requires {@link GL32 OpenGL 3.2}.

*/ public class KHRRobustness { /** Returned by {@link #glGetGraphicsResetStatus GetGraphicsResetStatus}. */ public static final int GL_NO_ERROR = 0x0, GL_GUILTY_CONTEXT_RESET = 0x8253, GL_INNOCENT_CONTEXT_RESET = 0x8254, GL_UNKNOWN_CONTEXT_RESET = 0x8255; /** Accepted by the {@code value} parameter of GetBooleanv, GetIntegerv, and GetFloatv. */ public static final int GL_CONTEXT_ROBUST_ACCESS = 0x90F3, GL_RESET_NOTIFICATION_STRATEGY = 0x8256; /** Returned by GetIntegerv and related simple queries when {@code value} is {@link #GL_RESET_NOTIFICATION_STRATEGY RESET_NOTIFICATION_STRATEGY}. */ public static final int GL_LOSE_CONTEXT_ON_RESET = 0x8252, GL_NO_RESET_NOTIFICATION = 0x8261; /** Returned by {@link GL11#glGetError GetError}. */ public static final int GL_CONTEXT_LOST = 0x507; static { GL.initialize(); } protected KHRRobustness() { throw new UnsupportedOperationException(); } static boolean isAvailable(GLCapabilities caps) { return checkFunctions( caps.glGetGraphicsResetStatus, caps.glReadnPixels, caps.glGetnUniformfv, caps.glGetnUniformiv, caps.glGetnUniformuiv ); } // --- [ glGetGraphicsResetStatus ] --- /** * Indicates if the GL context has been in a reset state at any point since the last call to GetGraphicsResetStatus: * *
    *
  • {@link GL11#GL_NO_ERROR NO_ERROR} indicates that the GL context has not been in a reset state since the last call.
  • *
  • {@link GL45#GL_GUILTY_CONTEXT_RESET GUILTY_CONTEXT_RESET} indicates that a reset has been detected that is attributable to the current GL context.
  • *
  • {@link GL45#GL_INNOCENT_CONTEXT_RESET INNOCENT_CONTEXT_RESET} indicates a reset has been detected that is not attributable to the current GL context.
  • *
  • {@link GL45#GL_UNKNOWN_CONTEXT_RESET UNKNOWN_CONTEXT_RESET} indicates a detected graphics reset whose cause is unknown.
  • *
* *

If a reset status other than NO_ERROR is returned and subsequent calls return NO_ERROR, the context reset was encountered and completed. If a reset * status is repeatedly returned, the context may be in the process of resetting.

* *

Reset notification behavior is determined at context creation time, and may be queried by calling GetIntegerv with the symbolic constant * {@link GL45#GL_RESET_NOTIFICATION_STRATEGY RESET_NOTIFICATION_STRATEGY}.

* *

If the reset notification behavior is {@link GL45#GL_NO_RESET_NOTIFICATION NO_RESET_NOTIFICATION}, then the implementation will never deliver notification of reset events, and * GetGraphicsResetStatus will always return NO_ERROR.

* *

If the behavior is {@link GL45#GL_LOSE_CONTEXT_ON_RESET LOSE_CONTEXT_ON_RESET}, a graphics reset will result in a lost context and require creating a new context as described * above. In this case GetGraphicsResetStatus will return an appropriate value from those described above.

* *

If a graphics reset notification occurs in a context, a notification must also occur in all other contexts which share objects with that context.

* *

After a graphics reset has occurred on a context, subsequent GL commands on that context (or any context which shares with that context) will generate a * {@link GL45#GL_CONTEXT_LOST CONTEXT_LOST} error. Such commands will not have side effects (in particular, they will not modify memory passed by pointer for query results, * and may not block indefinitely or cause termination of the application. Exceptions to this behavior include:

* *
    *
  • {@link GL11#glGetError GetError} and GetGraphicsResetStatus behave normally following a graphics reset, so that the application can determine a reset has * occurred, and when it is safe to destroy and recreate the context.
  • *
  • Any commands which might cause a polling application to block indefinitely will generate a CONTEXT_LOST error, but will also return a value * indicating completion to the application.
  • *
*/ public static native int glGetGraphicsResetStatus(); // --- [ glReadnPixels ] --- /** * Unsafe version of: {@link #glReadnPixels ReadnPixels} * * @param bufSize the maximum number of bytes to write into {@code data} */ public static native void nglReadnPixels(int x, int y, int width, int height, int format, int type, int bufSize, long pixels); /** * Behaves identically to {@link GL11#glReadPixels ReadPixels} except that it does not write more than {@code bufSize} bytes into {@code data} * * @param x the left pixel coordinate * @param y the lower pixel coordinate * @param width the number of pixels to read in the x-dimension * @param height the number of pixels to read in the y-dimension * @param format the pixel format. One of:
{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}
{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}
{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}
* @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
* @param bufSize the maximum number of bytes to write into {@code data} * @param pixels a buffer in which to place the returned pixel data */ public static void glReadnPixels(int x, int y, int width, int height, int format, int type, int bufSize, long pixels) { nglReadnPixels(x, y, width, height, format, type, bufSize, pixels); } /** * Behaves identically to {@link GL11#glReadPixels ReadPixels} except that it does not write more than {@code bufSize} bytes into {@code data} * * @param x the left pixel coordinate * @param y the lower pixel coordinate * @param width the number of pixels to read in the x-dimension * @param height the number of pixels to read in the y-dimension * @param format the pixel format. One of:
{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}
{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}
{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}
* @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
* @param pixels a buffer in which to place the returned pixel data */ public static void glReadnPixels(int x, int y, int width, int height, int format, int type, ByteBuffer pixels) { nglReadnPixels(x, y, width, height, format, type, pixels.remaining(), memAddress(pixels)); } /** * Behaves identically to {@link GL11#glReadPixels ReadPixels} except that it does not write more than {@code bufSize} bytes into {@code data} * * @param x the left pixel coordinate * @param y the lower pixel coordinate * @param width the number of pixels to read in the x-dimension * @param height the number of pixels to read in the y-dimension * @param format the pixel format. One of:
{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}
{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}
{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}
* @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
* @param pixels a buffer in which to place the returned pixel data */ public static void glReadnPixels(int x, int y, int width, int height, int format, int type, ShortBuffer pixels) { nglReadnPixels(x, y, width, height, format, type, pixels.remaining() << 1, memAddress(pixels)); } /** * Behaves identically to {@link GL11#glReadPixels ReadPixels} except that it does not write more than {@code bufSize} bytes into {@code data} * * @param x the left pixel coordinate * @param y the lower pixel coordinate * @param width the number of pixels to read in the x-dimension * @param height the number of pixels to read in the y-dimension * @param format the pixel format. One of:
{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}
{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}
{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}
* @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
* @param pixels a buffer in which to place the returned pixel data */ public static void glReadnPixels(int x, int y, int width, int height, int format, int type, IntBuffer pixels) { nglReadnPixels(x, y, width, height, format, type, pixels.remaining() << 2, memAddress(pixels)); } /** * Behaves identically to {@link GL11#glReadPixels ReadPixels} except that it does not write more than {@code bufSize} bytes into {@code data} * * @param x the left pixel coordinate * @param y the lower pixel coordinate * @param width the number of pixels to read in the x-dimension * @param height the number of pixels to read in the y-dimension * @param format the pixel format. One of:
{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}
{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}
{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}
* @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
* @param pixels a buffer in which to place the returned pixel data */ public static void glReadnPixels(int x, int y, int width, int height, int format, int type, FloatBuffer pixels) { nglReadnPixels(x, y, width, height, format, type, pixels.remaining() << 2, memAddress(pixels)); } // --- [ glGetnUniformfv ] --- /** * Unsafe version of: {@link #glGetnUniformfv GetnUniformfv} * * @param bufSize the maximum number of bytes to write to {@code params} */ public static native void nglGetnUniformfv(int program, int location, int bufSize, long params); /** * Returns the value or values of a uniform of the default uniform block. * * @param program the program object * @param location the uniform location * @param params the buffer in which to place the returned data */ public static void glGetnUniformfv(int program, int location, FloatBuffer params) { nglGetnUniformfv(program, location, params.remaining(), memAddress(params)); } /** * Returns the value or values of a uniform of the default uniform block. * * @param program the program object * @param location the uniform location */ public static float glGetnUniformf(int program, int location) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); try { FloatBuffer params = stack.callocFloat(1); nglGetnUniformfv(program, location, 1, memAddress(params)); return params.get(0); } finally { stack.setPointer(stackPointer); } } // --- [ glGetnUniformiv ] --- /** * Unsafe version of: {@link #glGetnUniformiv GetnUniformiv} * * @param bufSize the maximum number of bytes to write to {@code params} */ public static native void nglGetnUniformiv(int program, int location, int bufSize, long params); /** * Integer version of {@link #glGetnUniformfv GetnUniformfv}. * * @param program the program object * @param location the uniform location * @param params the buffer in which to place the returned data */ public static void glGetnUniformiv(int program, int location, FloatBuffer params) { nglGetnUniformiv(program, location, params.remaining(), memAddress(params)); } /** * Integer version of {@link #glGetnUniformfv GetnUniformfv}. * * @param program the program object * @param location the uniform location */ public static float glGetnUniformi(int program, int location) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); try { FloatBuffer params = stack.callocFloat(1); nglGetnUniformiv(program, location, 1, memAddress(params)); return params.get(0); } finally { stack.setPointer(stackPointer); } } // --- [ glGetnUniformuiv ] --- /** * Unsafe version of: {@link #glGetnUniformuiv GetnUniformuiv} * * @param bufSize the maximum number of bytes to write to {@code params} */ public static native void nglGetnUniformuiv(int program, int location, int bufSize, long params); /** * Unsigned version of {@link #glGetnUniformiv GetnUniformiv}. * * @param program the program object * @param location the uniform location * @param params the buffer in which to place the returned data */ public static void glGetnUniformuiv(int program, int location, FloatBuffer params) { nglGetnUniformuiv(program, location, params.remaining(), memAddress(params)); } /** * Unsigned version of {@link #glGetnUniformiv GetnUniformiv}. * * @param program the program object * @param location the uniform location */ public static float glGetnUniformui(int program, int location) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); try { FloatBuffer params = stack.callocFloat(1); nglGetnUniformuiv(program, location, 1, memAddress(params)); return params.get(0); } finally { stack.setPointer(stackPointer); } } /** Array version of: {@link #glReadnPixels ReadnPixels} */ public static void glReadnPixels(int x, int y, int width, int height, int format, int type, short[] pixels) { long __functionAddress = GL.getICD().glReadnPixels; if (CHECKS) { check(__functionAddress); } callPV(__functionAddress, x, y, width, height, format, type, pixels.length << 1, pixels); } /** Array version of: {@link #glReadnPixels ReadnPixels} */ public static void glReadnPixels(int x, int y, int width, int height, int format, int type, int[] pixels) { long __functionAddress = GL.getICD().glReadnPixels; if (CHECKS) { check(__functionAddress); } callPV(__functionAddress, x, y, width, height, format, type, pixels.length << 2, pixels); } /** Array version of: {@link #glReadnPixels ReadnPixels} */ public static void glReadnPixels(int x, int y, int width, int height, int format, int type, float[] pixels) { long __functionAddress = GL.getICD().glReadnPixels; if (CHECKS) { check(__functionAddress); } callPV(__functionAddress, x, y, width, height, format, type, pixels.length << 2, pixels); } /** Array version of: {@link #glGetnUniformfv GetnUniformfv} */ public static void glGetnUniformfv(int program, int location, float[] params) { long __functionAddress = GL.getICD().glGetnUniformfv; if (CHECKS) { check(__functionAddress); } callPV(__functionAddress, program, location, params.length, params); } /** Array version of: {@link #glGetnUniformiv GetnUniformiv} */ public static void glGetnUniformiv(int program, int location, float[] params) { long __functionAddress = GL.getICD().glGetnUniformiv; if (CHECKS) { check(__functionAddress); } callPV(__functionAddress, program, location, params.length, params); } /** Array version of: {@link #glGetnUniformuiv GetnUniformuiv} */ public static void glGetnUniformuiv(int program, int location, float[] params) { long __functionAddress = GL.getICD().glGetnUniformuiv; if (CHECKS) { check(__functionAddress); } callPV(__functionAddress, program, location, params.length, params); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy