org.lwjgl.opengl.ARBTextureMultisample Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of org.lwjgl.opengl Show documentation
Show all versions of org.lwjgl.opengl Show documentation
LWJGL OSGi bundle (OpenGL bindings)
/*
* 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 ARB_texture_multisample extension.
*
* This extension provides support for two new types of "multisample textures" - two-dimensional and two-dimensional array - as well as mechanisms to
* fetch a specific sample from such a texture in a shader, and to attach such textures to FBOs for rendering.
*
* This extension also includes the following functionality, first described in NV_explicit_multisample:
*
*
* - A query in the API to query the location of samples within the pixel
* - An explicit control for the multisample sample mask to augment the control provided by SampleCoverage
*
*
* Promoted to core in {@link GL32 OpenGL 3.2}.
*/
public class ARBTextureMultisample {
/** Accepted by the {@code pname} parameter of GetMultisamplefv. */
public static final int GL_SAMPLE_POSITION = 0x8E50;
/**
* Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and
* GetDoublev.
*/
public static final int GL_SAMPLE_MASK = 0x8E51;
/** Accepted by the {@code target} parameter of GetBooleani_v and GetIntegeri_v. */
public static final int GL_SAMPLE_MASK_VALUE = 0x8E52;
/** Accepted by the {@code target} parameter of BindTexture and TexImage2DMultisample. */
public static final int GL_TEXTURE_2D_MULTISAMPLE = 0x9100;
/** Accepted by the {@code target} parameter of TexImage2DMultisample. */
public static final int GL_PROXY_TEXTURE_2D_MULTISAMPLE = 0x9101;
/** Accepted by the {@code target} parameter of BindTexture and TexImage3DMultisample. */
public static final int GL_TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9102;
/** Accepted by the {@code target} parameter of TexImage3DMultisample. */
public static final int GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9103;
/** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv. */
public static final int
GL_MAX_SAMPLE_MASK_WORDS = 0x8E59,
GL_MAX_COLOR_TEXTURE_SAMPLES = 0x910E,
GL_MAX_DEPTH_TEXTURE_SAMPLES = 0x910F,
GL_MAX_INTEGER_SAMPLES = 0x9110,
GL_TEXTURE_BINDING_2D_MULTISAMPLE = 0x9104,
GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY = 0x9105;
/** Accepted by the {@code pname} parameter of GetTexLevelParameter. */
public static final int
GL_TEXTURE_SAMPLES = 0x9106,
GL_TEXTURE_FIXED_SAMPLE_LOCATIONS = 0x9107;
/** Returned by the {@code type} parameter of GetActiveUniform. */
public static final int
GL_SAMPLER_2D_MULTISAMPLE = 0x9108,
GL_INT_SAMPLER_2D_MULTISAMPLE = 0x9109,
GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE = 0x910A,
GL_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910B,
GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910C,
GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910D;
static { GL.initialize(); }
protected ARBTextureMultisample() {
throw new UnsupportedOperationException();
}
static boolean isAvailable(GLCapabilities caps) {
return checkFunctions(
caps.glTexImage2DMultisample, caps.glTexImage3DMultisample, caps.glGetMultisamplefv, caps.glSampleMaski
);
}
// --- [ glTexImage2DMultisample ] ---
/**
* Establishes the data storage, format, dimensions, and number of samples of a 2D multisample texture's image.
*
* @param target the target of the operation. One of:
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE} {@link GL32#GL_PROXY_TEXTURE_2D_MULTISAMPLE PROXY_TEXTURE_2D_MULTISAMPLE}
* @param samples the number of samples in the multisample texture's image
* @param internalformat the internal format to be used to store the multisample texture's image. {@code internalformat} must specify a color-renderable, depth-renderable,
* or stencil-renderable format.
* @param width the width of the multisample texture's image, in texels
* @param height the height of the multisample texture's image, in texels
* @param fixedsamplelocations whether the image will use identical sample locations and the same number of samples for all texels in the image, and the sample locations will not
* depend on the internal format or size of the image
*/
public static native void glTexImage2DMultisample(int target, int samples, int internalformat, int width, int height, boolean fixedsamplelocations);
// --- [ glTexImage3DMultisample ] ---
/**
* Establishes the data storage, format, dimensions, and number of samples of a 3D multisample texture's image.
*
* @param target the target of the operation. One of:
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY} {@link GL32#GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY}
* @param samples the number of samples in the multisample texture's image
* @param internalformat the internal format to be used to store the multisample texture's image. {@code internalformat} must specify a color-renderable, depth-renderable,
* or stencil-renderable format.
* @param width the width of the multisample texture's image, in texels
* @param height the height of the multisample texture's image, in texels
* @param depth the depth of the multisample texture's image, in texels
* @param fixedsamplelocations whether the image will use identical sample locations and the same number of samples for all texels in the image, and the sample locations will not
* depend on the internal format or size of the image
*/
public static native void glTexImage3DMultisample(int target, int samples, int internalformat, int width, int height, int depth, boolean fixedsamplelocations);
// --- [ glGetMultisamplefv ] ---
/** Unsafe version of: {@link #glGetMultisamplefv GetMultisamplefv} */
public static native void nglGetMultisamplefv(int pname, int index, long val);
/**
* Retrieves the location of a sample.
*
* @param pname the sample parameter name. Must be:
{@link GL32#GL_SAMPLE_POSITION SAMPLE_POSITION}
* @param index the index of the sample whose position to query
* @param val an array to receive the position of the sample
*/
public static void glGetMultisamplefv(int pname, int index, FloatBuffer val) {
if (CHECKS) {
check(val, 1);
}
nglGetMultisamplefv(pname, index, memAddress(val));
}
/**
* Retrieves the location of a sample.
*
* @param pname the sample parameter name. Must be:
{@link GL32#GL_SAMPLE_POSITION SAMPLE_POSITION}
* @param index the index of the sample whose position to query
*/
public static float glGetMultisamplef(int pname, int index) {
MemoryStack stack = stackGet(); int stackPointer = stack.getPointer();
try {
FloatBuffer val = stack.callocFloat(1);
nglGetMultisamplefv(pname, index, memAddress(val));
return val.get(0);
} finally {
stack.setPointer(stackPointer);
}
}
// --- [ glSampleMaski ] ---
/**
* Sets the value of a sub-word of the sample mask.
*
* @param index which 32-bit sub-word of the sample mask to update
* @param mask the new value of the mask sub-word
*/
public static native void glSampleMaski(int index, int mask);
/** Array version of: {@link #glGetMultisamplefv GetMultisamplefv} */
public static void glGetMultisamplefv(int pname, int index, float[] val) {
long __functionAddress = GL.getICD().glGetMultisamplefv;
if (CHECKS) {
check(__functionAddress);
check(val, 1);
}
callPV(__functionAddress, pname, index, val);
}
}