Example usage for org.lwjgl.opengl GL11 glTexCoord2d

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

Introduction

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

Prototype

public static native void glTexCoord2d(@NativeType("GLdouble") double s, @NativeType("GLdouble") double t);

Source Link

Document

Double version of #glTexCoord2f TexCoord2f .

Usage

From source file:fi.conf.ae.gl.text.GLBitmapFontBlitter.java

License:LGPL

public static void drawCircleString(String string, float charHeight, float freq, float radius, float phase,
        String font) {//from w w w  . ja  v a  2s  . c o m

    GL11.glPushMatrix();

    GLTextureManager.getInstance().bindTexture(font);
    //GL11.glBindTexture(GL11.GL_TEXTURE_2D, fontTextureID);

    GL11.glEnable(GL11.GL_DEPTH_TEST);

    //GLRoutines.drawSprite(0f, 0f, 2f, 2f, 1f);

    //GL11.glTranslatef(charWidth/2, -charHeight/2, 0);

    for (int i = 0; i < string.length(); i++) {

        char c = string.charAt(string.length() - 1 - i);
        float vx1 = (float) Math.sin(phase + freq * 2 * Math.PI * i / string.length()) * radius;
        float vy1 = (float) Math.cos(phase + freq * 2 * Math.PI * i / string.length()) * radius;
        float vx2 = (float) Math.sin(phase + freq * 2 * Math.PI * i / string.length()) * radius * charHeight;
        float vy2 = (float) Math.cos(phase + freq * 2 * Math.PI * i / string.length()) * radius * charHeight;

        float vx3 = (float) Math.sin(phase + freq * 2 * Math.PI * (i + 1) / string.length()) * radius;
        float vy3 = (float) Math.cos(phase + freq * 2 * Math.PI * (i + 1) / string.length()) * radius;
        float vx4 = (float) Math.sin(phase + freq * 2 * Math.PI * (i + 1) / string.length()) * radius
                * charHeight;
        float vy4 = (float) Math.cos(phase + freq * 2 * Math.PI * (i + 1) / string.length()) * radius
                * charHeight;

        float x1 = (c % 16f) / 16f;
        float x2 = (c % 16f) / 16f + 1f / 16f;
        float y1 = (c / 16) / 16f;
        float y2 = (c / 16) / 16f + 1f / 16f;

        //GL11.glColor3f((float)Math.random()*1.3f, (float)Math.random()*1.3f, (float)Math.random()*1.3f);
        //GL11.glBindTexture(GL11.GL_TEXTURE_2D, -1);
        GL11.glBegin(GL11.GL_QUADS);
        GL11.glTexCoord2d(x1, y1);
        GL11.glVertex3d(vy4, vx4, 0);
        GL11.glTexCoord2d(x1, y2);
        GL11.glVertex3d(vy3, vx3, 0);
        GL11.glTexCoord2d(x2, y2);
        GL11.glVertex3d(vy1, vx1, 0);
        GL11.glTexCoord2d(x2, y1);
        GL11.glVertex3d(vy2, vx2, 0);
        GL11.glEnd();

    }

    GL11.glPopMatrix();
}

From source file:fi.conf.prograts.ar.gl.GLBitmapFontBlitter.java

License:LGPL

public static void drawString(String string, String textureIdentifier, float charWidth, float charHeight,
        Alignment align) {/*from w  w w  .  ja  v a  2  s  .  c om*/

    float fix = 0;
    float overlap = 0.01f;

    if (align.equals(Alignment.CENTERED)) {
        fix = string.length() * charWidth * 0.5f;
    } else if (align.equals(Alignment.RIGHT)) {
        fix = string.length() * charWidth - overlap;
    }

    GL11.glPushMatrix();
    GL11.glTranslatef(0, -0.5f * charHeight, 0);
    //      System.out.println(textureID);
    GLTextureManager.getInstance().bindTexture(textureIdentifier);

    GL11.glBegin(GL11.GL_QUADS);

    for (int i = 0; i < string.length(); i++) {

        char c = string.charAt(i);

        float x1 = (c % 16f) / 16f;
        float x2 = x1 + 1f / 16f;
        float y1 = (c / 16) / 16f;
        float y2 = y1 + 1f / 16f;

        GL11.glTexCoord2d(x1 + overlap, y1);
        GL11.glVertex3d(i * charWidth - fix, 0, 0);
        GL11.glTexCoord2d(x1 + overlap, y2);
        GL11.glVertex3d(i * charWidth - fix, charHeight, 0);
        GL11.glTexCoord2d(x2 - overlap, y2);
        GL11.glVertex3d(i * charWidth + charWidth - fix, charHeight, 0);
        GL11.glTexCoord2d(x2 - overlap, y1);
        GL11.glVertex3d(i * charWidth + charWidth - fix, 0, 0);

    }

    GL11.glEnd();
    GL11.glPopMatrix();

}

From source file:fi.conf.prograts.ar.gl.GLBitmapFontBlitter.java

License:LGPL

public static void blitScrollerString(String string, float charWidth, float charHeight, float freq,
        float amplitude, float phase, String font) {

    float overlap = 0.2f;

    float fix = 0;

    GL11.glPushMatrix();/*from  w w  w . j  av  a 2  s . c o  m*/

    GLTextureManager.getInstance().bindTexture(font);
    //GL11.glBindTexture(GL11.GL_TEXTURE_2D, fontTextureID);

    GL11.glEnable(GL11.GL_DEPTH_TEST);

    //GLRoutines.drawSprite(0f, 0f, 2f, 2f, 1f);

    GL11.glBegin(GL11.GL_QUADS);

    for (int i = 0; i < string.length(); i++) {

        char c = string.charAt(i);
        float s = (float) Math.sin(phase + freq * 2 * Math.PI * i / string.length()) * amplitude;
        float x1 = (c % 16f) / 16f;
        float x2 = (c % 16f) / 16f + 1f / 16f;
        float y1 = (c / 16) / 16f;
        float y2 = (c / 16) / 16f + 1f / 16f;

        //drawSprite(x1, y1, x2, y2, 0);

        //GL11.glColor3f((float)Math.random()*1.3f, (float)Math.random()*1.3f, (float)Math.random()*1.3f);

        GL11.glTexCoord2d(x1, y1);
        GL11.glVertex3d(i * charWidth - fix - overlap, s, 0);
        GL11.glTexCoord2d(x1, y2);
        GL11.glVertex3d(i * charWidth - fix - overlap, charHeight + s, 0);
        GL11.glTexCoord2d(x2, y2);
        GL11.glVertex3d(i * charWidth + charWidth - fix, charHeight + s, 0);
        GL11.glTexCoord2d(x2, y1);
        GL11.glVertex3d(i * charWidth + charWidth - fix, s, 0);

    }

    GL11.glEnd();
    GL11.glPopMatrix();
}

From source file:fi.conf.prograts.ar.gl.GLBitmapFontBlitter.java

License:LGPL

public static void blitSinString(String string, float charWidth, float charHeight, float freq, float amplitude,
        float phase, String font) {

    float overlap = 0.2f;

    float fix = 0;

    GL11.glPushMatrix();//  ww  w . ja  v a 2 s  .c o m

    GLTextureManager.getInstance().bindTexture(font);
    //GL11.glBindTexture(GL11.GL_TEXTURE_2D, fontTextureID);

    GL11.glEnable(GL11.GL_DEPTH_TEST);

    //GLRoutines.drawSprite(0f, 0f, 2f, 2f, 1f);

    //GL11.glTranslatef(charWidth/2, -charHeight/2, 0);

    for (int i = 0; i < string.length(); i++) {

        char c = string.charAt(string.length() - 1 - i);
        float vx1 = (float) Math.sin(phase + freq * 2 * Math.PI * i / string.length()) * amplitude;
        float vy1 = (float) Math.cos(phase + freq * 2 * Math.PI * i / string.length()) * amplitude;
        float vx2 = (float) Math.sin(phase + freq * 2 * Math.PI * i / string.length()) * amplitude * charHeight;
        float vy2 = (float) Math.cos(phase + freq * 2 * Math.PI * i / string.length()) * amplitude * charHeight;

        float vx3 = (float) Math.sin(phase + freq * 2 * Math.PI * (i + 1) / string.length()) * amplitude;
        float vy3 = (float) Math.cos(phase + freq * 2 * Math.PI * (i + 1) / string.length()) * amplitude;
        float vx4 = (float) Math.sin(phase + freq * 2 * Math.PI * (i + 1) / string.length()) * amplitude
                * charHeight;
        float vy4 = (float) Math.cos(phase + freq * 2 * Math.PI * (i + 1) / string.length()) * amplitude
                * charHeight;

        float x1 = (c % 16f) / 16f;
        float x2 = (c % 16f) / 16f + 1f / 16f;
        float y1 = (c / 16) / 16f;
        float y2 = (c / 16) / 16f + 1f / 16f;

        //GL11.glColor3f((float)Math.random()*1.3f, (float)Math.random()*1.3f, (float)Math.random()*1.3f);
        //GL11.glBindTexture(GL11.GL_TEXTURE_2D, -1);
        GL11.glBegin(GL11.GL_QUADS);
        GL11.glTexCoord2d(x1, y1);
        GL11.glVertex3d(vy4, vx4, 0);
        GL11.glTexCoord2d(x1, y2);
        GL11.glVertex3d(vy3, vx3, 0);
        GL11.glTexCoord2d(x2, y2);
        GL11.glVertex3d(vy1, vx1, 0);
        GL11.glTexCoord2d(x2, y1);
        GL11.glVertex3d(vy2, vx2, 0);
        GL11.glEnd();

    }

    GL11.glPopMatrix();
}

From source file:fr.ign.cogit.geoxygene.appli.render.primitive.LinePrimitiveRenderer.java

License:Open Source License

/**
 * Render simple line./*  ww w  .  ja va 2 s .c  o m*/
 * @param primitive primitive to paint
 */
private void renderLine(final ParameterizedPolyline line) {
    if (line.getPointCount() < 2) {
        logger.warn("Line has " + line.getPointCount() + " points and cannot be rendered");
        return;
    }
    this.texture.initializeRendering();
    this.texture.setRange(0., 0, line.getParameter(line.getPointCount() - 1), 1);
    //    System.err.println("set range to " + this.texture.getMinX() + "x" + this.texture.getMinY() + " - " + this.texture.getMaxX() + "x"
    //        + this.texture.getMaxY());
    /**
     * p1 is the nth point, n1 the segment normal at p1 point 
     * p2 is the (n+1)th point, n2 the segment normal at p2 point
     * 
     * pXa, pXb are the 
     */
    Point2d p1 = line.getPoint(0); // nth point
    double p1t = line.getParameter(0);
    Point2d p2 = line.getPoint(1); // n+1 th point
    double p2t = line.getParameter(1);
    Point2d p3 = null; // n+2 th point
    Vector2d v1 = MathUtil.vector(p1, p2); // line direction at p1
    Vector2d v2 = null; // line direction at p2 
    Vector2d n1 = MathUtil.computeNormal(v1); // line normal at p1 (perpendicular to segment direction)
    Vector2d n2 = null; // line normal at p2 (perpendicular to segment direction)
    Point2d p1a = MathUtil.pointOfLine(p1, n1, -this.getLineWidth() / 2); // first stretched point at p1 (p1 + lineWidth/2 * n1)
    Point2d p1b = MathUtil.pointOfLine(p1, n1, this.getLineWidth() / 2); // second stretched point at p1 (p1 - lineWidth/2 * n1)
    Point2d p2a = null; // first stretched point at p2 (p2 + lineWidth/2 * n2)
    Point2d p2b = null; // second stretched point at p2 (p2 - lineWidth/2 * n2)

    if (line.getPointCount() <= 2) {
        p3 = p2;
        n2 = n1;
    }

    GL11.glPolygonMode(GL11.GL_FRONT_AND_BACK, GL11.GL_FILL);
    GL11.glBegin(GL11.GL_QUAD_STRIP);
    try {
        GL11.glTexCoord2d(p1t, 0);
        GLTools.glTexCoord(this.texture.vertexCoordinates(p1t, 0));
        GL11.glVertex2d(p1a.x, p1a.y);
        GLTools.glTexCoord(this.texture.vertexCoordinates(p1t, 1));
        GL11.glVertex2d(p1b.x, p1b.y);
        //      System.err.println("set first point coordinates = " + p1t + "x" + "0" + " => " + this.texture.vertexCoordinates(p1t, 0));
        //      System.err.println("set first point coordinates = " + p1t + "x" + "1" + " => " + this.texture.vertexCoordinates(p1t, 1));

        for (int nPoint = 0; nPoint < line.getPointCount() - 2; nPoint++) {

            p3 = line.getPoint(nPoint + 2);
            v2 = MathUtil.vector(p2, p3);
            n2 = MathUtil.computeNormal(v2);
            p2a = MathUtil.pointOfLine(p2, n2, -this.getLineWidth() / 2);
            p2b = MathUtil.pointOfLine(p2, n2, this.getLineWidth() / 2);
            p2t = line.getParameter(nPoint);

            Point2d Ia = MathUtil.intersectionPoint(p1a, v1, p2a, v2);
            Point2d Ib = MathUtil.intersectionPoint(p1b, v1, p2b, v2);
            if (Ia == null || Ib == null) {
                Ia = MathUtil.mean(p1a, p2a);
                Ib = MathUtil.mean(p1b, p2b);
            }

            GLTools.glTexCoord(this.texture.vertexCoordinates(p2t, 0));
            GL11.glVertex2d(Ia.x, Ia.y);
            GLTools.glTexCoord(this.texture.vertexCoordinates(p2t, 1));
            GL11.glVertex2d(Ib.x, Ib.y);

            //        System.err.println("set #" + nPoint + " point coordinates = " + p2t + "x" + "0" + " => " + this.texture.vertexCoordinates(p2t, 0));
            //        System.err.println("set #" + nPoint + " point coordinates = " + p2t + "x" + "1" + " => " + this.texture.vertexCoordinates(p2t, 1));
            // shift context to the next point
            p1 = p2;
            p1t = p2t;
            n1 = n2;
            v1 = v2;
            p1a = Ia;
            p1b = Ib;
            p2 = p3;

        }
        // draw the last point
        Point2d p3a = MathUtil.pointOfLine(p3, n2, -this.getLineWidth() / 2);
        Point2d p3b = MathUtil.pointOfLine(p3, n2, this.getLineWidth() / 2);
        double p3t = line.getParameter(line.getPointCount() - 1);
        GLTools.glTexCoord(this.texture.vertexCoordinates(p3t, 0));
        GL11.glVertex2d(p3a.x, p3a.y);
        GLTools.glTexCoord(this.texture.vertexCoordinates(p3t, 1));
        GL11.glVertex2d(p3b.x, p3b.y);
        //      System.err.println("set last point coordinates = " + p3t + "x" + "0" + " => " + this.texture.vertexCoordinates(p3t, 0));
        //      System.err.println("set last point coordinates = " + p3t + "x" + "1" + " => " + this.texture.vertexCoordinates(p3t, 1));
    } finally {
        GL11.glEnd();
    }

    this.texture.initializeRendering();

}

From source file:fr.ign.cogit.geoxygene.util.gl.GLTools.java

License:Open Source License

/**
 * set gl texture coordinate from a Point2D point
 *//*from   www.ja  va  2 s  .c  o m*/
public static void glTexCoord(final Point2d p) {
    GL11.glTexCoord2d(p.x, p.y);
}

From source file:illarion.graphics.lwjgl.render.TextureRenderImmediate.java

License:Open Source License

/**
 * Draw a texture at a specified location using the immediate mode.
 * // www .j  av a 2 s. com
 * @param x the x coordinate of the texture
 * @param y the y coordinate of the texture
 * @param z the z coordinate (so the layer) of the texture
 * @param width the width of the area the texture shall be rendered on
 * @param height the height of the area the texture shall be rendered on
 * @param texture the texture that shall be drawn
 * @param color the color that is supposed to be used with that texture
 * @param mirror mirror the texture horizontal
 * @param rotation the value the texture is rotated by
 */
@Override
public void drawTexture(final float x, final float y, final float z, final float width, final float height,
        final TextureLWJGL texture, final SpriteColor color, final boolean mirror, final float rotation) {

    DriverSettingsLWJGL.getInstance().enableTexture(texture.getTextureID());
    color.setActiveColor();

    GL11.glPushMatrix();

    int xmod = 1;
    if (mirror) {
        xmod = -1;
        GL11.glTranslatef(x + width, y, z);
    } else {
        GL11.glTranslatef(x, y, z);
    }

    GL11.glScalef(width * xmod, height, 1.f);
    GL11.glTranslatef(0.5f, 0.5f, 0);

    if (rotation != 0.f) {
        GL11.glRotatef(rotation, 0, 0, 1);
    }

    GL11.glBegin(GL11.GL_TRIANGLE_STRIP);

    if (mirror) {
        GL11.glTexCoord2d(texture.getRelX2(), texture.getRelY2());
        GL11.glVertex2f(-0.5f, -0.5f);
        GL11.glTexCoord2d(texture.getRelX2(), texture.getRelY1());
        GL11.glVertex2f(-0.5f, 0.5f);
        GL11.glTexCoord2d(texture.getRelX1(), texture.getRelY2());
        GL11.glVertex2f(0.5f, -0.5f);
        GL11.glTexCoord2d(texture.getRelX1(), texture.getRelY1());
        GL11.glVertex2f(0.5f, 0.5f);
    } else {
        GL11.glTexCoord2d(texture.getRelX1(), texture.getRelY2());
        GL11.glVertex2f(-0.5f, -0.5f);
        GL11.glTexCoord2d(texture.getRelX1(), texture.getRelY1());
        GL11.glVertex2f(-0.5f, 0.5f);
        GL11.glTexCoord2d(texture.getRelX2(), texture.getRelY2());
        GL11.glVertex2f(0.5f, -0.5f);
        GL11.glTexCoord2d(texture.getRelX2(), texture.getRelY1());
        GL11.glVertex2f(0.5f, 0.5f);
    }

    GL11.glEnd();
    GL11.glPopMatrix();
}

From source file:net.voidGameDev.world.surface.WorldSurfaceRender.java

License:Open Source License

public void setUpHeightmap(String heightMap, String texture) {
    try {// w  w w .ja  v a2 s  .  c o  m
        // Load the heightmap-image from its resource file
        BufferedImage heightmapImage = ImageIO.read(getClass().getResource(heightMap));
        // Initialise the data array, which holds the heights of the
        // heightmap-vertices, with the correct dimensions
        data = new float[heightmapImage.getWidth()][heightmapImage.getHeight()];
        // Lazily initialise the convenience class for extracting the
        // separate red, green, blue, or alpha channels
        // an int in the default RGB color model and default sRGB
        // colourspace.
        Color colour;
        // Iterate over the pixels in the image on the x-axis
        for (int z = 0; z < data.length; z++) {
            // Iterate over the pixels in the image on the y-axis
            for (int x = 0; x < data[z].length; x++) {
                // Retrieve the colour at the current x-location and
                // y-location in the image
                colour = new Color(heightmapImage.getRGB(x, z));
                // Store the value of the red channel as the height of a
                // heightmap-vertex in 'data'. The choice for
                // the red channel is arbitrary, since the heightmap-image
                // itself only has white, gray, and black.
                data[z][x] = colour.getRed();
            }
        }

    } catch (IOException e) {
        e.printStackTrace();
    }

    // Generate a display list handle for the display list that will store
    // the heightmap vertex data
    heightmapDisplayList = glGenLists(32);
    // version 3 and higher.
    GL11.glEnable(GL_TEXTURE_2D);
    int z = 0;
    int x = 0;
    glBindTexture(GL_TEXTURE_2D, loadTexture(texture));
    for (int i = 0; i < 32; i++) {
        glNewList(heightmapDisplayList + i, GL_COMPILE);
        // Iterate over the 'strips' of heightmap data.
        outerLoop: for (; z < data.length - 1; z++) {
            // Render a quad strip for each 'strip'.
            glBegin(GL11.GL_QUAD_STRIP);
            for (; x < data[z].length; x++) {
                // Take a vertex from the current strip
                GL11.glTexCoord2d(x, z);
                glVertex3f(x, data[x][z], z);
                // Take a vertex from the next strip
                glVertex3f(x, data[x][z + 1], z + 1);
                if ((x + 1) % 32 == 0 && (z + 1) % 32 == 0) {
                    glEnd();
                    glEndList();
                    System.out.println(x + ":" + z);
                    break outerLoop;
                } else {
                    System.out.println((x + 1) % 32);
                }
            }
        }
    }
    System.out.println("DOne");
}

From source file:Src.Framework.Game.java

private void load() {
    //load splash screen and display it before loading everything else
    try {/*from   w  w w .  j a  va  2s .c o  m*/
        logo = TextureLoader.getTexture("PNG",
                ResourceLoader.getResourceAsStream("Src/Resources/Images/LemonzapLogo.png"));
        GL11.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST);
    } catch (IOException e) {
        e.printStackTrace();
    }
    //bind white before binding any textures
    Color.white.bind();
    logo.bind();
    GL11.glBegin(GL11.GL_QUADS);
    GL11.glTexCoord2d(0, 0);
    GL11.glVertex2i(0, 0);

    GL11.glTexCoord2d(1, 0);
    GL11.glVertex2i(1024, 0);

    GL11.glTexCoord2d(1, 1);
    GL11.glVertex2i(1024, 512);

    GL11.glTexCoord2d(0, 1);
    GL11.glVertex2i(0, 512);
    GL11.glEnd();
    glfwSwapBuffers(window.getWindowHandle());

    //loading resources for main menu
    Audio.loadOpenAL();
    MainMenu.load();
    OptionsMenu.load();
    OptionsAudioMenu.load();

}

From source file:Src.Framework.Menus.MainMenu.java

public static void render() {
    //bind white before binding any textures
    Color.white.bind();/*from   w  ww.j  a  v  a  2  s .co m*/
    menuBackground.bind();
    GL11.glBegin(GL11.GL_QUADS);
    GL11.glTexCoord2d(0, 0);
    GL11.glVertex2i(0, 0);

    GL11.glTexCoord2d(1, 0);
    GL11.glVertex2i(1024, 0);

    GL11.glTexCoord2d(1, 1);
    GL11.glVertex2i(1024, 512);

    GL11.glTexCoord2d(0, 1);
    GL11.glVertex2i(0, 512);
    GL11.glEnd();
    //render title
    Color.white.bind();
    title.bind();
    GL11.glBegin(GL11.GL_QUADS);
    GL11.glTexCoord2d(0, 0);
    GL11.glVertex2i(256, 0);

    GL11.glTexCoord2d(1, 0);
    GL11.glVertex2i(768, 0);

    GL11.glTexCoord2d(1, 1);
    GL11.glVertex2i(768, 167);

    GL11.glTexCoord2d(0, 1);
    GL11.glVertex2i(256, 167);
    GL11.glEnd();

    switch (selection) {
    case 1:
        //render menu selections
        Color.white.bind();
        singleplayerSelected.bind();
        GL11.glBegin(GL11.GL_QUADS);
        GL11.glTexCoord2d(0, 0);
        GL11.glVertex2i(256, 192);

        GL11.glTexCoord2d(1, 0);
        GL11.glVertex2i(768, 192);

        GL11.glTexCoord2d(1, 1);
        GL11.glVertex2i(768, 256);

        GL11.glTexCoord2d(0, 1);
        GL11.glVertex2i(256, 256);
        GL11.glEnd();

        Color.white.bind();
        multiplayer.bind();
        GL11.glBegin(GL11.GL_QUADS);
        GL11.glTexCoord2d(0, 0);
        GL11.glVertex2i(256, 256);

        GL11.glTexCoord2d(1, 0);
        GL11.glVertex2i(768, 256);

        GL11.glTexCoord2d(1, 1);
        GL11.glVertex2i(768, 320);

        GL11.glTexCoord2d(0, 1);
        GL11.glVertex2i(256, 320);
        GL11.glEnd();

        Color.white.bind();
        stageCreator.bind();
        GL11.glBegin(GL11.GL_QUADS);
        GL11.glTexCoord2d(0, 0);
        GL11.glVertex2i(256, 320);

        GL11.glTexCoord2d(1, 0);
        GL11.glVertex2i(768, 320);

        GL11.glTexCoord2d(1, 1);
        GL11.glVertex2i(768, 384);

        GL11.glTexCoord2d(0, 1);
        GL11.glVertex2i(256, 384);
        GL11.glEnd();

        Color.white.bind();
        options.bind();
        GL11.glBegin(GL11.GL_QUADS);
        GL11.glTexCoord2d(0, 0);
        GL11.glVertex2i(256, 384);

        GL11.glTexCoord2d(1, 0);
        GL11.glVertex2i(768, 384);

        GL11.glTexCoord2d(1, 1);
        GL11.glVertex2i(768, 448);

        GL11.glTexCoord2d(0, 1);
        GL11.glVertex2i(256, 448);
        GL11.glEnd();

        Color.white.bind();
        exit.bind();
        GL11.glBegin(GL11.GL_QUADS);
        GL11.glTexCoord2d(0, 0);
        GL11.glVertex2i(256, 448);

        GL11.glTexCoord2d(1, 0);
        GL11.glVertex2i(768, 448);

        GL11.glTexCoord2d(1, 1);
        GL11.glVertex2i(768, 512);

        GL11.glTexCoord2d(0, 1);
        GL11.glVertex2i(256, 512);
        GL11.glEnd();
        break;
    case 2:
        Color.white.bind();
        singleplayer.bind();
        GL11.glBegin(GL11.GL_QUADS);
        GL11.glTexCoord2d(0, 0);
        GL11.glVertex2i(256, 192);

        GL11.glTexCoord2d(1, 0);
        GL11.glVertex2i(768, 192);

        GL11.glTexCoord2d(1, 1);
        GL11.glVertex2i(768, 256);

        GL11.glTexCoord2d(0, 1);
        GL11.glVertex2i(256, 256);
        GL11.glEnd();

        Color.white.bind();
        multiplayerSelected.bind();
        GL11.glBegin(GL11.GL_QUADS);
        GL11.glTexCoord2d(0, 0);
        GL11.glVertex2i(256, 256);

        GL11.glTexCoord2d(1, 0);
        GL11.glVertex2i(768, 256);

        GL11.glTexCoord2d(1, 1);
        GL11.glVertex2i(768, 320);

        GL11.glTexCoord2d(0, 1);
        GL11.glVertex2i(256, 320);
        GL11.glEnd();

        Color.white.bind();
        stageCreator.bind();
        GL11.glBegin(GL11.GL_QUADS);
        GL11.glTexCoord2d(0, 0);
        GL11.glVertex2i(256, 320);

        GL11.glTexCoord2d(1, 0);
        GL11.glVertex2i(768, 320);

        GL11.glTexCoord2d(1, 1);
        GL11.glVertex2i(768, 384);

        GL11.glTexCoord2d(0, 1);
        GL11.glVertex2i(256, 384);
        GL11.glEnd();

        Color.white.bind();
        options.bind();
        GL11.glBegin(GL11.GL_QUADS);
        GL11.glTexCoord2d(0, 0);
        GL11.glVertex2i(256, 384);

        GL11.glTexCoord2d(1, 0);
        GL11.glVertex2i(768, 384);

        GL11.glTexCoord2d(1, 1);
        GL11.glVertex2i(768, 448);

        GL11.glTexCoord2d(0, 1);
        GL11.glVertex2i(256, 448);
        GL11.glEnd();

        Color.white.bind();
        exit.bind();
        GL11.glBegin(GL11.GL_QUADS);
        GL11.glTexCoord2d(0, 0);
        GL11.glVertex2i(256, 448);

        GL11.glTexCoord2d(1, 0);
        GL11.glVertex2i(768, 448);

        GL11.glTexCoord2d(1, 1);
        GL11.glVertex2i(768, 512);

        GL11.glTexCoord2d(0, 1);
        GL11.glVertex2i(256, 512);
        GL11.glEnd();
        break;
    case 3:
        Color.white.bind();
        singleplayer.bind();
        GL11.glBegin(GL11.GL_QUADS);
        GL11.glTexCoord2d(0, 0);
        GL11.glVertex2i(256, 192);

        GL11.glTexCoord2d(1, 0);
        GL11.glVertex2i(768, 192);

        GL11.glTexCoord2d(1, 1);
        GL11.glVertex2i(768, 256);

        GL11.glTexCoord2d(0, 1);
        GL11.glVertex2i(256, 256);
        GL11.glEnd();

        Color.white.bind();
        multiplayer.bind();
        GL11.glBegin(GL11.GL_QUADS);
        GL11.glTexCoord2d(0, 0);
        GL11.glVertex2i(256, 256);

        GL11.glTexCoord2d(1, 0);
        GL11.glVertex2i(768, 256);

        GL11.glTexCoord2d(1, 1);
        GL11.glVertex2i(768, 320);

        GL11.glTexCoord2d(0, 1);
        GL11.glVertex2i(256, 320);
        GL11.glEnd();

        Color.white.bind();
        stageCreatorSelected.bind();
        GL11.glBegin(GL11.GL_QUADS);
        GL11.glTexCoord2d(0, 0);
        GL11.glVertex2i(256, 320);

        GL11.glTexCoord2d(1, 0);
        GL11.glVertex2i(768, 320);

        GL11.glTexCoord2d(1, 1);
        GL11.glVertex2i(768, 384);

        GL11.glTexCoord2d(0, 1);
        GL11.glVertex2i(256, 384);
        GL11.glEnd();

        Color.white.bind();
        options.bind();
        GL11.glBegin(GL11.GL_QUADS);
        GL11.glTexCoord2d(0, 0);
        GL11.glVertex2i(256, 384);

        GL11.glTexCoord2d(1, 0);
        GL11.glVertex2i(768, 384);

        GL11.glTexCoord2d(1, 1);
        GL11.glVertex2i(768, 448);

        GL11.glTexCoord2d(0, 1);
        GL11.glVertex2i(256, 448);
        GL11.glEnd();

        Color.white.bind();
        exit.bind();
        GL11.glBegin(GL11.GL_QUADS);
        GL11.glTexCoord2d(0, 0);
        GL11.glVertex2i(256, 448);

        GL11.glTexCoord2d(1, 0);
        GL11.glVertex2i(768, 448);

        GL11.glTexCoord2d(1, 1);
        GL11.glVertex2i(768, 512);

        GL11.glTexCoord2d(0, 1);
        GL11.glVertex2i(256, 512);
        GL11.glEnd();
        break;
    case 4:
        Color.white.bind();
        singleplayer.bind();
        GL11.glBegin(GL11.GL_QUADS);
        GL11.glTexCoord2d(0, 0);
        GL11.glVertex2i(256, 192);

        GL11.glTexCoord2d(1, 0);
        GL11.glVertex2i(768, 192);

        GL11.glTexCoord2d(1, 1);
        GL11.glVertex2i(768, 256);

        GL11.glTexCoord2d(0, 1);
        GL11.glVertex2i(256, 256);
        GL11.glEnd();

        Color.white.bind();
        multiplayer.bind();
        GL11.glBegin(GL11.GL_QUADS);
        GL11.glTexCoord2d(0, 0);
        GL11.glVertex2i(256, 256);

        GL11.glTexCoord2d(1, 0);
        GL11.glVertex2i(768, 256);

        GL11.glTexCoord2d(1, 1);
        GL11.glVertex2i(768, 320);

        GL11.glTexCoord2d(0, 1);
        GL11.glVertex2i(256, 320);
        GL11.glEnd();

        Color.white.bind();
        stageCreator.bind();
        GL11.glBegin(GL11.GL_QUADS);
        GL11.glTexCoord2d(0, 0);
        GL11.glVertex2i(256, 320);

        GL11.glTexCoord2d(1, 0);
        GL11.glVertex2i(768, 320);

        GL11.glTexCoord2d(1, 1);
        GL11.glVertex2i(768, 384);

        GL11.glTexCoord2d(0, 1);
        GL11.glVertex2i(256, 384);
        GL11.glEnd();

        Color.white.bind();
        optionsSelected.bind();
        GL11.glBegin(GL11.GL_QUADS);
        GL11.glTexCoord2d(0, 0);
        GL11.glVertex2i(256, 384);

        GL11.glTexCoord2d(1, 0);
        GL11.glVertex2i(768, 384);

        GL11.glTexCoord2d(1, 1);
        GL11.glVertex2i(768, 448);

        GL11.glTexCoord2d(0, 1);
        GL11.glVertex2i(256, 448);
        GL11.glEnd();

        Color.white.bind();
        exit.bind();
        GL11.glBegin(GL11.GL_QUADS);
        GL11.glTexCoord2d(0, 0);
        GL11.glVertex2i(256, 448);

        GL11.glTexCoord2d(1, 0);
        GL11.glVertex2i(768, 448);

        GL11.glTexCoord2d(1, 1);
        GL11.glVertex2i(768, 512);

        GL11.glTexCoord2d(0, 1);
        GL11.glVertex2i(256, 512);
        GL11.glEnd();
        break;
    case 5:
        Color.white.bind();
        singleplayer.bind();
        GL11.glBegin(GL11.GL_QUADS);
        GL11.glTexCoord2d(0, 0);
        GL11.glVertex2i(256, 192);

        GL11.glTexCoord2d(1, 0);
        GL11.glVertex2i(768, 192);

        GL11.glTexCoord2d(1, 1);
        GL11.glVertex2i(768, 256);

        GL11.glTexCoord2d(0, 1);
        GL11.glVertex2i(256, 256);
        GL11.glEnd();

        Color.white.bind();
        multiplayer.bind();
        GL11.glBegin(GL11.GL_QUADS);
        GL11.glTexCoord2d(0, 0);
        GL11.glVertex2i(256, 256);

        GL11.glTexCoord2d(1, 0);
        GL11.glVertex2i(768, 256);

        GL11.glTexCoord2d(1, 1);
        GL11.glVertex2i(768, 320);

        GL11.glTexCoord2d(0, 1);
        GL11.glVertex2i(256, 320);
        GL11.glEnd();

        Color.white.bind();
        stageCreator.bind();
        GL11.glBegin(GL11.GL_QUADS);
        GL11.glTexCoord2d(0, 0);
        GL11.glVertex2i(256, 320);

        GL11.glTexCoord2d(1, 0);
        GL11.glVertex2i(768, 320);

        GL11.glTexCoord2d(1, 1);
        GL11.glVertex2i(768, 384);

        GL11.glTexCoord2d(0, 1);
        GL11.glVertex2i(256, 384);
        GL11.glEnd();

        Color.white.bind();
        options.bind();
        GL11.glBegin(GL11.GL_QUADS);
        GL11.glTexCoord2d(0, 0);
        GL11.glVertex2i(256, 384);

        GL11.glTexCoord2d(1, 0);
        GL11.glVertex2i(768, 384);

        GL11.glTexCoord2d(1, 1);
        GL11.glVertex2i(768, 448);

        GL11.glTexCoord2d(0, 1);
        GL11.glVertex2i(256, 448);
        GL11.glEnd();

        Color.white.bind();
        exitSelected.bind();
        GL11.glBegin(GL11.GL_QUADS);
        GL11.glTexCoord2d(0, 0);
        GL11.glVertex2i(256, 448);

        GL11.glTexCoord2d(1, 0);
        GL11.glVertex2i(768, 448);

        GL11.glTexCoord2d(1, 1);
        GL11.glVertex2i(768, 512);

        GL11.glTexCoord2d(0, 1);
        GL11.glVertex2i(256, 512);
        GL11.glEnd();
        break;

    }
}