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

org.lwjgl.opengles.ANGLETranslatedShaderSource Maven / Gradle / Ivy

Go to download

A royalty-free, cross-platform API for full-function 2D and 3D graphics on embedded systems - including consoles, phones, appliances and vehicles.

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

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 ANGLE_translated_shader_source extension.
 * 
 * 

WebGL uses the GLSL ES 2.0 spec on all platforms, and translates these shaders to the host platform's native language (HLSL, GLSL, and even GLSL ES). * For debugging purposes, it is useful to be able to examine the shader after translation.

* *

This extension addes a new function to query the translated shader source, and adds a new enum for GetShaderiv's <pname> parameter to query the * translated shader source length.

* *

Requires {@link GLES20 GLES 2.0}.

*/ public class ANGLETranslatedShaderSource { /** Accepted by the {@code pname} parameter of GetShaderiv. */ public static final int GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE = 0x93A0; protected ANGLETranslatedShaderSource() { throw new UnsupportedOperationException(); } static boolean isAvailable(GLESCapabilities caps) { return checkFunctions( caps.glGetTranslatedShaderSourceANGLE ); } // --- [ glGetTranslatedShaderSourceANGLE ] --- public static void nglGetTranslatedShaderSourceANGLE(int shader, int bufsize, long length, long source) { long __functionAddress = GLES.getCapabilities().glGetTranslatedShaderSourceANGLE; if ( CHECKS ) checkFunctionAddress(__functionAddress); callPPV(__functionAddress, shader, bufsize, length, source); } public static void glGetTranslatedShaderSourceANGLE(int shader, IntBuffer length, ByteBuffer source) { if ( CHECKS ) checkBufferSafe(length, 1); nglGetTranslatedShaderSourceANGLE(shader, source.remaining(), memAddressSafe(length), memAddress(source)); } public static String glGetTranslatedShaderSourceANGLE(int shader, int bufsize) { MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); ByteBuffer source = memAlloc(bufsize); try { IntBuffer length = stack.ints(0); nglGetTranslatedShaderSourceANGLE(shader, bufsize, memAddress(length), memAddress(source)); return memUTF8(source, length.get(0)); } finally { memFree(source); stack.setPointer(stackPointer); } } public static String glGetTranslatedShaderSourceANGLE(int shader) { int bufsize = GLES20.glGetShaderi(shader, GL_TRANSLATED_SHADER_SOURCE_LENGTH_ANGLE); MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); ByteBuffer source = memAlloc(bufsize); try { IntBuffer length = stack.ints(0); nglGetTranslatedShaderSourceANGLE(shader, bufsize, memAddress(length), memAddress(source)); return memUTF8(source, length.get(0)); } finally { memFree(source); stack.setPointer(stackPointer); } } /** Array version of: {@link #glGetTranslatedShaderSourceANGLE GetTranslatedShaderSourceANGLE} */ public static void glGetTranslatedShaderSourceANGLE(int shader, int[] length, ByteBuffer source) { long __functionAddress = GLES.getCapabilities().glGetTranslatedShaderSourceANGLE; if ( CHECKS ) { checkFunctionAddress(__functionAddress); checkBufferSafe(length, 1); } callPPV(__functionAddress, shader, source.remaining(), length, memAddress(source)); } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy