Example usage for org.lwjgl.opengl GL11 glEnd

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

Introduction

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

Prototype

public static native void glEnd();

Source Link

Document

Ends the definition of vertex attributes of a sequence of primitives to be transferred to the GL.

Usage

From source file:org.ajgl.graphics.DisplayList.java

License:Open Source License

/**
 * Compiles or and draws a display list.
 * @param listID - The display list handler
 * @param beginMode - The OpenGL begin mode
 * @param compileMode - The OpenGL compile mode
 * @param values - The array of vertices
 *//*ww  w.j a  va 2  s .  c  om*/
@OpenGLInfo(fwdCompatible = false, openGLVersion = "1.1", status = "Deprecated")
public static void compileTwoPointList(int listID, @BeginMode int beginMode, @CompileMode int compileMode,
        float... values) {
    GL11.glNewList(listID, compileMode);
    GL11.glBegin(beginMode);
    for (int i = 0; i < values.length - 1; i += 2)
        GL11.glVertex2f(values[i], values[i + 1]);
    GL11.glEnd();
    GL11.glEndList();
}

From source file:org.ajgl.graphics.DisplayList.java

License:Open Source License

/**
 * Compiles or and draws a display list.
 * @param listID - The display list handler
 * @param beginMode - The OpenGL begin mode
 * @param compileMode - The OpenGL compile mode
 * @param values - The array of vertices
 *///  www.  jav  a2 s  .  co m
@OpenGLInfo(fwdCompatible = false, openGLVersion = "1.1", status = "Deprecated")
public static void compileThreePointList(int listID, @BeginMode int beginMode, @CompileMode int compileMode,
        float... values) {
    GL11.glNewList(listID, compileMode);
    GL11.glBegin(beginMode);
    for (int i = 0; i < values.length - 2; i += 3)
        GL11.glVertex3f(values[i], values[i + 1], values[i + 2]);
    GL11.glEnd();
    GL11.glEndList();
}

From source file:org.ajgl.graphics.DisplayList.java

License:Open Source License

/**
 * Compiles or and draws a display list.
 * @param listID - The display list handler
 * @param beginMode - The OpenGL begin mode
 * @param compileMode - The OpenGL compile mode
 * @param values - The array of vertices
 *///from w w w. ja v  a2  s  .co  m
@OpenGLInfo(fwdCompatible = false, openGLVersion = "1.1", status = "Deprecated")
public static void compileFourPointList(int listID, @BeginMode int beginMode, @CompileMode int compileMode,
        float... values) {
    GL11.glNewList(listID, compileMode);
    GL11.glBegin(beginMode);
    for (int i = 0; i < values.length - 3; i += 4)
        GL11.glVertex4f(values[i], values[i + 1], values[i + 2], values[i + 3]);
    GL11.glEnd();
    GL11.glEndList();
}

From source file:org.ajgl.graphics.DisplayList.java

License:Open Source License

/**
 * Compiles or and draws a display list with color.
 * Note that {@code colorValues} should have four values per vertex.
 * @param listID - The display list handler
 * @param beginMode - The OpenGL begin mode
 * @param compileMode - The OpenGL compile mode
 * @param vertexValues - The array of vertices
 * @param colorValues - The array of color vertices
 *//*from www  . j  a  v a2 s.  c  om*/
@OpenGLInfo(fwdCompatible = false, openGLVersion = "1.1", status = "Deprecated")
public static void compileTwoPointList(int listID, @BeginMode int beginMode, @CompileMode int compileMode,
        float[] vertexValues, float[] colorValues) {
    GL11.glNewList(listID, compileMode);
    GL11.glBegin(beginMode);
    for (int i = 0, j = 0; i < vertexValues.length - 1; i += 2, j += 4) {
        GL11.glColor4f(colorValues[j], colorValues[j + 1], colorValues[j + 2], colorValues[j + 3]);
        GL11.glVertex2f(vertexValues[i], vertexValues[i + 1]);
    }
    GL11.glEnd();
    GL11.glEndList();
}

From source file:org.ajgl.graphics.DisplayList.java

License:Open Source License

/**
 * Compiles or and draws a display list with color.
 * Note that {@code colorValues} should have four values per vertex.
 * @param listID - The display list handler
 * @param beginMode - The OpenGL begin mode
 * @param compileMode - The OpenGL compile mode
 * @param vertexValues - The array of vertices
 * @param colorValues - The array of color vertices
 *//*ww w  . j  av a  2  s. co  m*/
@OpenGLInfo(fwdCompatible = false, openGLVersion = "1.1", status = "Deprecated")
public static void compileThreePointList(int listID, @BeginMode int beginMode, @CompileMode int compileMode,
        float[] vertexValues, float[] colorValues) {
    GL11.glNewList(listID, compileMode);
    GL11.glBegin(beginMode);
    for (int i = 0, j = 0; i < vertexValues.length - 2; i += 3, j += 4) {
        GL11.glColor4f(colorValues[j], colorValues[j + 1], colorValues[j + 2], colorValues[j + 3]);
        GL11.glVertex3f(vertexValues[i], vertexValues[i + 1], vertexValues[i + 2]);
    }
    GL11.glEnd();
    GL11.glEndList();
}

From source file:org.ajgl.graphics.DisplayList.java

License:Open Source License

/**
 * Compiles or and draws a display list with color.
 * Note that {@code colorValues} should have four values per vertex.
 * @param listID - The display list handler
 * @param beginMode - The OpenGL begin mode
 * @param compileMode - The OpenGL compile mode
 * @param vertexValues - The array of vertices
 * @param colorValues - The array of color vertices
 *//*from  w  w w .j av a 2s. c om*/
@OpenGLInfo(fwdCompatible = false, openGLVersion = "1.1", status = "Deprecated")
public static void compileFourPointList(int listID, @BeginMode int beginMode, @CompileMode int compileMode,
        float[] vertexValues, float[] colorValues) {
    GL11.glNewList(listID, compileMode);
    GL11.glBegin(beginMode);
    for (int i = 0, j = 0; i < vertexValues.length - 3; i += 4, j += 4) {
        GL11.glColor4f(colorValues[j], colorValues[j + 1], colorValues[j + 2], colorValues[j + 3]);
        GL11.glVertex4f(vertexValues[i], vertexValues[i + 1], vertexValues[i + 2], vertexValues[i + 3]);
    }
    GL11.glEnd();
    GL11.glEndList();
}

From source file:org.ajgl.graphics.DisplayList.java

License:Open Source License

/**
 * Compiles or and draws a display list with a texture.
 * @param listID - The display list handler
 * @param beginMode - The OpenGL begin mode
 * @param compileMode - The OpenGL compile mode
 * @param textureID - The texture id to be used
 * @param vertexValues - The array of vertices
 * @param textureValues - Array of local texture vertices
 *//*from  w w  w .jav  a 2  s .co  m*/
@OpenGLInfo(fwdCompatible = false, openGLVersion = "1.1", status = "Deprecated")
public static void compileTwoPointList(int listID, @BeginMode int beginMode, @CompileMode int compileMode,
        int textureID, float[] vertexValues, float[] textureValues) {
    GL11.glNewList(listID, compileMode);
    GL11.glBindTexture(GL11.GL_TEXTURE_2D, textureID);
    GL11.glBegin(beginMode);
    for (int i = 0; i < vertexValues.length - 1; i += 2) {
        GL11.glTexCoord2f(textureValues[i], textureValues[i + 1]);
        GL11.glVertex2f(vertexValues[i], vertexValues[i + 1]);
    }
    GL11.glEnd();
    GL11.glEndList();
}

From source file:org.ajgl.graphics.DisplayList.java

License:Open Source License

/**
 * Compiles or and draws a display list with a texture.
 * @param listID - The display list handler
 * @param beginMode - The OpenGL begin mode
 * @param compileMode - The OpenGL compile mode
 * @param textureID - The texture id to be used
 * @param vertexValues - The array of vertices
 * @param textureValues - Array of local texture vertices
 *//*from  w  ww . java  2  s. co m*/
@OpenGLInfo(fwdCompatible = false, openGLVersion = "1.1", status = "Deprecated")
public static void compileThreePointList(int listID, @BeginMode int beginMode, @CompileMode int compileMode,
        int textureID, float[] vertexValues, float[] textureValues) {
    GL11.glNewList(listID, compileMode);
    GL11.glBindTexture(GL11.GL_TEXTURE_2D, textureID);
    GL11.glBegin(beginMode);
    for (int i = 0, j = 0; i < vertexValues.length - 2; i += 3, j += 2) {
        GL11.glTexCoord2f(textureValues[j], textureValues[j + 1]);
        GL11.glVertex3f(vertexValues[i], vertexValues[i + 1], vertexValues[i + 2]);
    }
    GL11.glEnd();
    GL11.glEndList();
}

From source file:org.ajgl.graphics.DisplayList.java

License:Open Source License

/**
 * Compiles or and draws a display list with a texture.
 * @param listID - The display list handler
 * @param beginMode - The OpenGL begin mode
 * @param compileMode - The OpenGL compile mode
 * @param textureID - The texture id to be used
 * @param vertexValues - The array of vertices
 * @param textureValues - Array of local texture vertices
 *//*from  w ww  .  j  a v  a 2  s.c om*/
@OpenGLInfo(fwdCompatible = false, openGLVersion = "1.1", status = "Deprecated")
public static void compileFourPointList(int listID, @BeginMode int beginMode, @CompileMode int compileMode,
        int textureID, float[] vertexValues, float[] textureValues) {
    GL11.glNewList(listID, compileMode);
    GL11.glBindTexture(GL11.GL_TEXTURE_2D, textureID);
    GL11.glBegin(beginMode);
    for (int i = 0, j = 0; i < vertexValues.length - 3; i += 4, j += 2) {
        GL11.glTexCoord2f(textureValues[j], textureValues[j + 1]);
        GL11.glVertex4f(vertexValues[i], vertexValues[i + 1], vertexValues[i + 2], vertexValues[i + 3]);
    }
    GL11.glEnd();
    GL11.glEndList();
}

From source file:org.ajgl.graphics.DisplayList.java

License:Open Source License

/**
 * Compiles or and draws a display list with color and a texture.
 * Note that {@code colorValues} should have four values per vertex.
 * @param listID - The display list handler
 * @param beginMode - The OpenGL begin mode
 * @param compileMode - The OpenGL compile mode
 * @param textureID - The texture id to be used
 * @param vertexValues - The array of vertices
 * @param colorValues - The array of color vertices
 * @param textureValues - Array of local texture vertices
 *///from www.  j  a  v  a  2 s . c o  m
@OpenGLInfo(fwdCompatible = false, openGLVersion = "1.1", status = "Deprecated")
public static void compileTwoPointList(int listID, @BeginMode int beginMode, @CompileMode int compileMode,
        int textureID, float[] vertexValues, float[] colorValues, float[] textureValues) {
    GL11.glNewList(listID, compileMode);
    GL11.glBindTexture(GL11.GL_TEXTURE_2D, textureID);
    GL11.glBegin(beginMode);
    for (int i = 0, j = 0; i < vertexValues.length - 1; i += 2, j += 4) {
        GL11.glColor4f(colorValues[j], colorValues[j + 1], colorValues[j + 2], colorValues[j + 3]);
        GL11.glTexCoord2f(textureValues[i], textureValues[i + 1]);
        GL11.glVertex2f(vertexValues[i], vertexValues[i + 1]);
    }
    GL11.glEnd();
    GL11.glEndList();
}