Example usage for org.lwjgl.opengl GL11 glIsEnabled

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

Introduction

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

Prototype

@NativeType("GLboolean")
public static boolean glIsEnabled(@NativeType("GLenum") int cap) 

Source Link

Document

Determines if cap is currently enabled (as with #glEnable Enable ) or disabled.

Usage

From source file:de.minebench.zombe.liteloader.minecraft.GLHelper.java

License:Open Source License

@Override
public void beginRender(float t) {

    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240, 240);

    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    glEnableBlend();//from www  .  ja  va  2s . c o m
    glDisableTexture2D();

    fogEnabled = GL11.glIsEnabled(GL_FOG);
    glDisableFog();

    glPushMatrix();

    EntityPlayerSP player = Minecraft.getMinecraft().player;
    double x = player.prevPosX + (player.posX - player.prevPosX) * t;
    double y = player.prevPosY + (player.posY - player.prevPosY) * t;
    double z = player.prevPosZ + (player.posZ - player.prevPosZ) * t;
    glTranslated(-x, -y, -z);
}

From source file:io.root.gfx.glutils.GL.java

License:Apache License

public static boolean glIsEnabled(int cap) {
    return GL11.glIsEnabled(cap);
}

From source file:org.jmangos.tools.openGL.FontTT.java

License:Open Source License

public void drawText(final String whatchars, final float size, final float x, final float y, final float z,
        final Color color, final float rotxpass, final float rotypass, final float rotzpass,
        final boolean centered) {

    final float fontsizeratio = size / this.fontsize;

    final int tempkerneling = this.kerneling;

    int k = 0;/*from  www.  j  av a2  s  . c o m*/
    final float realwidth = getWidth(whatchars, size, false);
    GL11.glPushMatrix();
    final boolean islightingon = GL11.glIsEnabled(GL11.GL_LIGHTING);

    if (islightingon) {
        GL11.glDisable(GL11.GL_LIGHTING);
    }

    GL11.glTranslatef(x, y, z);
    GL11.glRotatef(rotxpass, 1, 0, 0);
    GL11.glRotatef(rotypass, 0, 1, 0);
    GL11.glRotatef(rotzpass, 0, 0, 1);
    float totalwidth = 0;
    if (centered) {
        totalwidth = -realwidth / 2f;
    }
    for (int i = 0; i < whatchars.length(); i++) {
        final String tempstr = whatchars.substring(i, i + 1);
        k = ((this.charlistp.get(tempstr))).charnum;
        drawtexture(this.charactersp[k], fontsizeratio, totalwidth, 0, color, rotxpass, rotypass, rotzpass);
        totalwidth += ((this.charactersp[k].getImageWidth() * fontsizeratio) + tempkerneling);
    }
    if (islightingon) {
        GL11.glEnable(GL11.GL_LIGHTING);
    }
    GL11.glPopMatrix();

}

From source file:org.jmangos.tools.openGL.FontTT.java

License:Open Source License

public void drawOutlinedText(final String whatchars, final float size, final float x, final float y,
        final float z, final Color color, final Color outlinecolor, final float rotxpass, final float rotypass,
        final float rotzpass, final boolean centered) {

    final float fontsizeratio = size / this.fontsize;

    final float tempkerneling = this.kerneling;

    int k = 0;/*from  ww w. j ava2s .  c o m*/
    int ko = 0;
    final float realwidth = getWidth(whatchars, size, true);
    GL11.glPushMatrix();
    final boolean islightingon = GL11.glIsEnabled(GL11.GL_LIGHTING);

    if (islightingon) {
        GL11.glDisable(GL11.GL_LIGHTING);
    }

    GL11.glTranslatef(x, y, z);
    GL11.glRotatef(rotxpass, 1, 0, 0);
    GL11.glRotatef(rotypass, 0, 1, 0);
    GL11.glRotatef(rotzpass, 0, 0, 1);
    float xoffset, yoffset;
    float totalwidth = 0;
    if (centered) {
        totalwidth = -realwidth / 2f;
    }
    for (int i = 0; i < whatchars.length(); i++) {
        final String tempstr = whatchars.substring(i, i + 1);
        ko = ((this.charlisto.get(tempstr))).charnum;
        drawtexture(this.characterso[ko], fontsizeratio, totalwidth, 0, outlinecolor, rotxpass, rotypass,
                rotzpass);

        k = ((this.charlistp.get(tempstr))).charnum;
        xoffset = ((this.characterso[k].getImageWidth() - this.charactersp[k].getImageWidth()) * fontsizeratio)
                / 2f;
        yoffset = ((this.characterso[k].getImageHeight() - this.charactersp[k].getImageHeight())
                * fontsizeratio) / 2f;
        drawtexture(this.charactersp[k], fontsizeratio, totalwidth + xoffset, yoffset, color, rotxpass,
                rotypass, rotzpass);
        totalwidth += ((this.characterso[k].getImageWidth() * fontsizeratio) + tempkerneling);
    }
    if (islightingon) {
        GL11.glEnable(GL11.GL_LIGHTING);
    }
    GL11.glPopMatrix();

}

From source file:org.oscim.gdx.LwjglGL20.java

License:Apache License

public boolean isEnabled(int cap) {
    return GL11.glIsEnabled(cap);
}

From source file:playn.java.JavaGL20.java

License:Apache License

@Override
public boolean glIsEnabled(int cap) {
    return GL11.glIsEnabled(cap);
}

From source file:processing.lwjgl.PLWJGL.java

License:Open Source License

public boolean isEnabled(int value) {
    return GL11.glIsEnabled(value);
}

From source file:processing.opengl.PLWJGL.java

License:Open Source License

@Override
public boolean isEnabled(int value) {
    return GL11.glIsEnabled(value);
}

From source file:tech.flatstone.appliedlogistics.common.util.OpenGLHelper.java

License:Open Source License

public static int[][] saveGLState(int[] bitsToSave) {
    if (bitsToSave == null) {
        return null;
    }/*from   w ww.  jav  a  2  s .c om*/

    int[][] savedGLState = new int[bitsToSave.length][2];
    int count = 0;

    for (int glBit : bitsToSave) {
        savedGLState[count][0] = glBit;
        savedGLState[count++][1] = GL11.glIsEnabled(glBit) ? 1 : 0;
    }

    return savedGLState;
}

From source file:tech.flatstone.appliedlogistics.common.util.OpenGLHelper.java

License:Open Source License

public static int[][] modifyGLState(int[] bitsToDisable, int[] bitsToEnable, int[] bitsToSave) {
    if (bitsToDisable == null && bitsToEnable == null && bitsToSave == null) {
        return null;
    }/* w ww.jav  a  2s.  com*/

    int[][] savedGLState = new int[(bitsToDisable != null ? bitsToDisable.length : 0)
            + (bitsToEnable != null ? bitsToEnable.length : 0)
            + (bitsToSave != null ? bitsToSave.length : 0)][2];
    int count = 0;

    if (bitsToDisable != null) {
        for (int glBit : bitsToDisable) {
            savedGLState[count][0] = glBit;
            savedGLState[count++][1] = GL11.glIsEnabled(glBit) ? 1 : 0;
            GL11.glDisable(glBit);
        }
    }

    if (bitsToEnable != null) {
        for (int glBit : bitsToEnable) {
            savedGLState[count][0] = glBit;
            savedGLState[count++][1] = GL11.glIsEnabled(glBit) ? 1 : 0;
            GL11.glEnable(glBit);
        }
    }

    if (bitsToSave != null) {
        for (int glBit : bitsToSave) {
            savedGLState[count][0] = glBit;
            savedGLState[count++][1] = GL11.glIsEnabled(glBit) ? 1 : 0;
        }
    }

    return savedGLState;
}