Java Code Examples for com.jogamp.opengl.GL#glGetIntegerv()

The following examples show how to use com.jogamp.opengl.GL#glGetIntegerv() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Caps.java    From jogl-samples with MIT License 5 votes vote down vote up
public Caps(GL gl, Profile profile) {

        initVersion(gl, profile);
        initExtensions(gl);
        if (check(4, 3) || extensi.KHR_debug) {
            gl.glGetIntegerv(GL_CONTEXT_FLAGS, data);
            version.CONTEXT_FLAGS = data.get(0);
        }
        initDebug(gl);
        initLimits(gl);
        initValues(gl);
        initFormats(gl);
    }
 
Example 2
Source File: Caps.java    From jogl-samples with MIT License 5 votes vote down vote up
private void initDebug(GL gl) {

        debug = new DebugData();

        gl.glGetIntegerv(GL_CONTEXT_FLAGS, data);
        debug.CONTEXT_FLAGS = data.get(0);
        gl.glGetIntegerv(GL_MAX_DEBUG_GROUP_STACK_DEPTH, data);
        debug.MAX_DEBUG_GROUP_STACK_DEPTH = data.get(0);
        gl.glGetIntegerv(GL_MAX_LABEL_LENGTH, data);
        debug.MAX_LABEL_LENGTH = data.get(0);
        gl.glGetIntegerv(GL_MAX_SERVER_WAIT_TIMEOUT, data);
        debug.MAX_SERVER_WAIT_TIMEOUT = data.get(0);
    }
 
Example 3
Source File: MSAATool.java    From jogl-samples with MIT License 5 votes vote down vote up
public static void dumpBlend(final GL gl) {
    final int[] vi = new int[] { 0, 0, 0, 0 };
    gl.glGetIntegerv(GL.GL_BLEND, vi, 0);
    gl.glGetIntegerv(GL.GL_BLEND_SRC_ALPHA, vi, 1);
    gl.glGetIntegerv(GL.GL_BLEND_SRC_RGB, vi, 2);
    gl.glGetIntegerv(GL.GL_BLEND_DST_RGB, vi, 3);
    final boolean blendEnabled = vi[0] == GL.GL_TRUE;
    System.out.println("GL_BLEND "+blendEnabled+"/"+glIsEnabled(gl, GL.GL_BLEND) +
                       "  GL_SRC_ALPHA 0x"+Integer.toHexString(vi[1])+
                       "  GL_SRC_RGB 0x"+Integer.toHexString(vi[2])+
                       "  GL_DST_RGB 0x"+Integer.toHexString(vi[3]));
}
 
Example 4
Source File: Caps.java    From jogl-samples with MIT License 4 votes vote down vote up
private void initVersion(GL gl, Profile profile) {

        version = new VersionData(profile);

        gl.glGetIntegerv(GL_MINOR_VERSION, data);
        version.MINOR_VERSION = data.get(0);
        gl.glGetIntegerv(GL_MAJOR_VERSION, data);
        version.MAJOR_VERSION = data.get(0);

        version.RENDERER = gl.glGetString(GL_RENDERER);
        version.VENDOR = gl.glGetString(GL_VENDOR);
        version.VERSION = gl.glGetString(GL_VERSION);
        version.SHADING_LANGUAGE_VERSION = gl.glGetString(GL_SHADING_LANGUAGE_VERSION);

        if (check(3, 0)) {

            gl.glGetIntegerv(GL_NUM_EXTENSIONS, data);
            version.NUM_EXTENSIONS = data.get(0);
        }
        if (check(4, 3)) {

            GL4 gl4 = (GL4) gl;

            gl.glGetIntegerv(GL_NUM_SHADING_LANGUAGE_VERSIONS, data);
            version.NUM_SHADING_LANGUAGE_VERSIONS = data.get(0);

            for (int i = 0; i < version.NUM_SHADING_LANGUAGE_VERSIONS; i++) {

                String v = gl4.glGetStringi(GL_SHADING_LANGUAGE_VERSION, i);

                switch (v) {
                    case "100":
                        version.GLSL100 = true;
                        break;
                    case "110":
                        version.GLSL110 = true;
                        break;
                    case "120":
                        version.GLSL120 = true;
                        break;
                    case "130":
                        version.GLSL130 = true;
                        break;
                    case "140":
                        version.GLSL140 = true;
                        break;
                    case "150 core":
                        version.GLSL150Core = true;
                        break;
                    case "150 compatibility":
                        version.GLSL150Comp = true;
                        break;
                    case "300 es":
                        version.GLSL300ES = true;
                        break;
                    case "330 core":
                        version.GLSL330Core = true;
                        break;
                    case "330 compatibility":
                        version.GLSL330Comp = true;
                        break;
                    case "400 core":
                        version.GLSL400Core = true;
                        break;
                    case "400 compatibility":
                        version.GLSL400Comp = true;
                        break;
                    case "410 core":
                        version.GLSL410Core = true;
                        break;
                    case "410 compatibility":
                        version.GLSL410Comp = true;
                        break;
                    case "420 core":
                        version.GLSL420Core = true;
                        break;
                    case "420 compatibility":
                        version.GLSL420Comp = true;
                        break;
                    case "430 core":
                        version.GLSL430Core = true;
                        break;
                    case "440 compatibility":
                        version.GLSL440Comp = true;
                        break;
                    case "440 core":
                        version.GLSL440Core = true;
                        break;
                }
            }
        }
    }