Example usage for org.lwjgl.opengl GL11 glGetInteger

List of usage examples for org.lwjgl.opengl GL11 glGetInteger

Introduction

In this page you can find the example usage for org.lwjgl.opengl GL11 glGetInteger.

Prototype

@NativeType("void")
public static int glGetInteger(@NativeType("GLenum") int pname) 

Source Link

Document

Returns the current integer value of the specified state variable.

Usage

From source file:mwisbest.openbase.OpenBASE.java

License:Open Source License

private void render() {
    Common.render(this.framerateLimit);
    this.customRender();
    Common.currentTextureID = GL11.glGetInteger(GL11.GL_TEXTURE_BINDING_2D);
    Display.update();//from w w w  .j  av  a 2 s . co  m
    if (Display.isCloseRequested())
        this.running = false;
}

From source file:net.smert.frameworkgl.opengl.OpenGL1.java

License:Apache License

public int getAvailableStencilBits() {
    return GL11.glGetInteger(GL11.GL_STENCIL_BITS);
}

From source file:net.smert.frameworkgl.opengl.OpenGL3.java

License:Apache License

public int getMaxColorAttachments() {
    return GL11.glGetInteger(GL30.GL_MAX_COLOR_ATTACHMENTS);
}

From source file:org.meanworks.engine.util.Util.java

License:Open Source License

public static int getNVIDIAMemory() {
    int nvidia_total_memory = GL11
            .glGetInteger(NVXGpuMemoryInfo.GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX);
    return nvidia_total_memory;
}

From source file:org.obsidianbox.obsidian.renderer.GuiRenderer.java

License:MIT License

@Override
public void render() {
    // Snapshot Minecraft rendering
    final int mcProgId = GL11.glGetInteger(GL20.GL_CURRENT_PROGRAM);
    final int mcVAID = GL11.glGetInteger(GL11.GL_VERTEX_ARRAY);

    updateScaledAttributes();/*from   w w  w  .ja v a 2 s .  co  m*/

    LWJGLUtil.checkForGLError();
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    pipeline.run(context);
    GL11.glDisable(GL11.GL_BLEND);
    LWJGLUtil.checkForGLError();

    GL20.glUseProgram(mcProgId);
    GL30.glBindVertexArray(mcVAID);
    LWJGLUtil.checkForGLError();
}

From source file:org.spout.engine.SpoutClient.java

License:Open Source License

public void initRenderer() {
    createWindow();/*from   ww w.j  a  v a2 s . co  m*/

    //Mouse.setGrabbed(true);

    getLogger().info("SpoutClient Information");
    getLogger().info("Operating System: " + System.getProperty("os.name"));
    getLogger().info("Renderer Mode: " + this.getRenderMode().toString());
    getLogger().info("OpenGL Information");
    getLogger().info("Vendor: " + GL11.glGetString(GL11.GL_VENDOR));
    getLogger().info("OpenGL Version: " + GL11.glGetString(GL11.GL_VERSION));
    getLogger().info("GLSL Version: " + GL11.glGetString(GL20.GL_SHADING_LANGUAGE_VERSION));
    getLogger().info("Max Textures: " + GL11.glGetString(GL20.GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS));
    String extensions = "Extensions Supported: ";
    if (getArguments().renderMode == RenderMode.GL30) {
        for (int i = 0; i < GL11.glGetInteger(GL30.GL_NUM_EXTENSIONS); i++) {
            extensions += GL30.glGetStringi(GL11.GL_EXTENSIONS, i) + " ";
        }
    } else {
        extensions += GL11.glGetString(GL11.GL_EXTENSIONS);
    }
    getLogger().info(extensions);
    soundManager.init();
    Spout.getFilesystem().postStartup();

    GL11.glEnable(GL11.GL_DEPTH_TEST);
    GL11.glClearColor((135.f / 255.0f), 206.f / 255.f, 250.f / 255.f, 0);

    worldRenderer = new WorldRenderer(this);
    worldRenderer.setup();

    renderer = new PrimitiveBatch();
    mat = (RenderMaterial) this.getFilesystem()
            .getResource("material://Spout/resources/resources/materials/BasicMaterial.smt");
    renderer.begin();
    renderer.addCube(new Vector3(-0.5, -0.5, -0.5), Vector3.ONE, Color.RED, sides);
    renderer.end();

    gui = new SpriteBatch();
}

From source file:org.spout.engine.SpoutRenderer.java

License:Open Source License

public void initRenderer(Canvas parent) {
    createWindow(parent);//from   w  ww .  ja  v a2s. c om

    if (Spout.debugMode()) {
        client.getLogger().info("SpoutClient Information");
        client.getLogger().info("Operating System: " + System.getProperty("os.name"));
        client.getLogger().info("Renderer Mode: " + client.getRenderMode().toString());
        client.getLogger().info("GL21: " + GLContext.getCapabilities().OpenGL21 + " GL32: "
                + GLContext.getCapabilities().OpenGL32);
        client.getLogger().info("Resolution: " + Display.getWidth() + "x" + Display.getHeight());
        client.getLogger().info("OpenGL Information");
        client.getLogger().info("Vendor: " + GL11.glGetString(GL11.GL_VENDOR));
        client.getLogger().info("OpenGL Version: " + GL11.glGetString(GL11.GL_VERSION));
        client.getLogger().info("GLSL Version: " + GL11.glGetString(GL20.GL_SHADING_LANGUAGE_VERSION));
        client.getLogger().info("Max Textures: " + GL11.glGetInteger(GL20.GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS));
        String extensions = "Extensions Supported: ";
        if (client.getRenderMode() == RenderMode.GL30 || client.getRenderMode() == RenderMode.GL40) {
            for (int i = 0; i < GL11.glGetInteger(GL30.GL_NUM_EXTENSIONS); i++) {
                extensions += GL30.glGetStringi(GL11.GL_EXTENSIONS, i) + " ";
            }
        } else {
            extensions += GL11.glGetString(GL11.GL_EXTENSIONS);
        }
        client.getLogger().info(extensions);
    }

    SpoutRenderer.checkGLError();
    GL11.glEnable(GL11.GL_DEPTH_TEST);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glEnable(GL11.GL_CULL_FACE);
    GL11.glFrontFace(GL11.GL_CW);
    GL11.glCullFace(GL11.GL_BACK);
    SpoutRenderer.checkGLError();

    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glClearColor((135.f / 255.0f), 206.f / 255.f, 250.f / 255.f, 1);
    SpoutRenderer.checkGLError();

    //Init pool of BatchVertexRenderer
    BatchVertexRenderer.initPool(GL11.GL_TRIANGLES, 500);

    if (useReflexion) {
        reflected = new ClientRenderTexture(true, false, true);
        reflected.writeGPU();
        // Test
        reflectedDebugBatch = new SpriteBatch();
        Shader s1 = client.getFileSystem().getResource("shader://Spout/shaders/diffuse.ssf");
        HashMap<String, Object> map1 = new HashMap<>();
        map1.put("Diffuse", reflected);
        reflectedDebugMat = new ClientRenderMaterial(s1, map1);
        RenderPart screenPart1 = new RenderPart();
        screenPart1.setSprite(new Rectangle(-1, -1, 0.5f, 0.5f));
        screenPart1.setSource(new Rectangle(0, 1, 1, -1));
        RenderPartPack pack1 = new RenderPartPack(reflectedDebugMat);
        pack1.add(screenPart1);
        reflectedDebugBatch.flush(pack1);
        // Test end
    }

    screenBatcher = new SpriteBatch();
    t = new ClientRenderTexture(true, false, true);
    t.writeGPU();
    Shader s = client.getFileSystem().getResource("shader://Spout/shaders/diffuse.ssf");
    HashMap<String, Object> map = new HashMap<>();
    map.put("Diffuse", t);
    mat = new ClientRenderMaterial(s, map);
    RenderPart screenPart = new RenderPart();
    screenPart.setSprite(new Rectangle(-1, -1, 2, 2));
    screenPart.setSource(new Rectangle(0, 1, 1, -1));
    RenderPartPack pack = new RenderPartPack(mat);
    pack.add(screenPart);
    screenBatcher.flush(pack);
}

From source file:playn.java.JavaGL20.java

License:Apache License

@Override
public int glGetInteger(int pname) {
    return GL11.glGetInteger(pname);
}

From source file:shadowmage.meim.client.gui.GuiTextureElement.java

License:Open Source License

private void bindTexture() {
    prevTexNum = GL11.glGetInteger(GL11.GL_TEXTURE_BINDING_2D);
    GL11.glBindTexture(GL11.GL_TEXTURE_2D, openGLTextureNumber);
}

From source file:shadowmage.meim.client.texture.TextureManager.java

License:Open Source License

public static void bindTexture() {
    prevTexNum = GL11.glGetInteger(GL11.GL_TEXTURE_BINDING_2D);
    GL11.glBindTexture(GL11.GL_TEXTURE_2D, texNum);
}