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:myfirstgame.Spinner.java

public void drawSpinner() {

    GL11.glBegin(GL_QUADS);
    glVertex2i(x, y);
    glVertex2i(x + sizeX, y);
    glVertex2i(x + sizeX, y + sizeY);
    glVertex2i(x, y + sizeY);
    GL11.glEnd();
}

From source file:myfirstgame.symbol.java

public void draw() {
    texture.bind();/*from   w  w w.j  av a2 s.c om*/
    GL11.glBegin(GL_QUADS);
    glTexCoord2f(0, 1);
    glVertex2i(x, y);
    glTexCoord2f(1, 1);
    glVertex2i(x + sizeX, y);
    glTexCoord2f(1, 0);
    glVertex2i(x + sizeX, y + sizeY);
    glTexCoord2f(0, 0);
    glVertex2i(x, y + sizeY);
    GL11.glEnd();
}

From source file:myfirstgame.toolBar.java

public void draw(Texture tex) {

    tex.bind();/*w  ww .ja  v a 2s.c o m*/
    GL11.glBegin(GL_QUADS);
    GL11.glTexCoord2f(0, 1);
    glVertex2i(x, y);
    GL11.glTexCoord2f(1, 1);
    glVertex2i(x + 45, y);
    GL11.glTexCoord2f(1, 0);
    glVertex2i(x + 45, y + 250);
    GL11.glTexCoord2f(0, 0);
    glVertex2i(x, y + 250);
    GL11.glEnd();
}

From source file:myfirstgame.Tree.java

public void outline() {
    GL11.glLineWidth((float) 2.5);
    GL11.glColor3f(255, 0, 0);//from  www  . j a  v  a 2s . c  o m
    GL11.glBegin(GL11.GL_LINES);
    GL11.glVertex2f(treex, treey);
    GL11.glVertex2f(treex, treey + sizeY);
    GL11.glEnd();

    GL11.glBegin(GL11.GL_LINES);
    GL11.glVertex2f(treex, treey + sizeY);
    GL11.glVertex2f(treex + sizeX, treey + sizeY);
    GL11.glEnd();

    GL11.glBegin(GL11.GL_LINES);
    GL11.glVertex2f(treex + sizeX, treey + sizeY);
    GL11.glVertex2f(treex + sizeX, treey);
    GL11.glEnd();

    GL11.glBegin(GL11.GL_LINES);
    GL11.glVertex2f(treex + sizeX, treey);
    GL11.glVertex2f(treex, treey);
    GL11.glEnd();

    GL11.glColor3f(255, 255, 255);

}

From source file:myfirstgame.Tree.java

public void drawTree(Texture tex) {
    outline();/*  w ww.jav a  2 s  . c o  m*/
    tex.bind();
    GL11.glBegin(GL_QUADS);
    glTexCoord2f(0, 1);
    glVertex2i(treex, treey);
    glTexCoord2f(1, 1);
    glVertex2i(treex + sizeX, treey);
    glTexCoord2f(1, 0);
    glVertex2i(treex + sizeX, treey + sizeY);
    glTexCoord2f(0, 0);
    glVertex2i(treex, treey + sizeY);
    GL11.glEnd();
}

From source file:myfirstgame.Tree.java

public static void drawTree() {

    GL11.glBegin(GL_QUADS);/* w w w  .  ja va2s. c o  m*/
    glVertex2i(treex, treey);
    glVertex2i(treex + sizeX, treey);
    glVertex2i(treex + sizeX, treey + sizeY);
    glVertex2i(treex, treey + sizeY);
    GL11.glEnd();
}

From source file:naftoreiclag.splendidanimator.Application.java

License:MIT License

public void renderGL() {
    GL11.glColor3f(0.5f, 0.5f, 1.0f);//w  w  w  .j  av  a  2  s  .co  m

    GL11.glPushMatrix();

    GL11.glBegin(GL11.GL_QUADS);
    GL11.glVertex2f(100 - 50, 100 - 50);
    GL11.glVertex2f(100 + 50, 100 - 50);
    GL11.glVertex2f(100 + 50, 100 + 50);
    GL11.glVertex2f(100 - 50, 100 + 50);
    GL11.glEnd();

}

From source file:name.martingeisse.minimal.simulation.subject.FullySimulatedSubject.java

License:Open Source License

@Override
public void drawCell(final int x, final int y, int pattern) {
    if (pattern < 0 || pattern > 15) {
        pattern = 0;//from ww  w.  jav  a2s . c  o  m
    }
    switch (pattern) {

    case 0:
        GL11.glColor3f(0.0f, 0.0f, 0.0f);
        break;

    case 1:
        GL11.glColor3f(0.0f, 0.0f, 0.5f);
        break;

    case 2:
        GL11.glColor3f(0.0f, 0.5f, 0.0f);
        break;

    case 3:
        GL11.glColor3f(0.0f, 0.5f, 0.5f);
        break;

    case 4:
        GL11.glColor3f(0.5f, 0.0f, 0.0f);
        break;

    case 5:
        GL11.glColor3f(0.5f, 0.0f, 0.5f);
        break;

    case 6:
        GL11.glColor3f(0.5f, 0.5f, 0.0f);
        break;

    case 7:
        GL11.glColor3f(0.75f, 0.75f, 0.75f);
        break;

    case 8:
        GL11.glColor3f(0.5f, 0.5f, 0.5f);
        break;

    case 9:
        GL11.glColor3f(0.0f, 0.0f, 1.0f);
        break;

    case 10:
        GL11.glColor3f(0.0f, 1.0f, 0.0f);
        break;

    case 11:
        GL11.glColor3f(0.0f, 1.0f, 1.0f);
        break;

    case 12:
        GL11.glColor3f(1.0f, 0.0f, 0.0f);
        break;

    case 13:
        GL11.glColor3f(1.0f, 0.0f, 1.0f);
        break;

    case 14:
        GL11.glColor3f(1.0f, 1.0f, 0.0f);
        break;

    case 15:
        GL11.glColor3f(1.0f, 1.0f, 1.0f);
        break;

    }
    GL11.glBegin(GL11.GL_QUADS);
    GL11.glVertex2i(x * 20, y * 20);
    GL11.glVertex2i(x * 20 + 20, y * 20);
    GL11.glVertex2i(x * 20 + 20, y * 20 + 20);
    GL11.glVertex2i(x * 20, y * 20 + 20);
    GL11.glEnd();
}

From source file:name.martingeisse.stackd.client.gui.element.FillColor.java

License:Open Source License

@Override
protected void draw() {
    GL11.glDisable(GL11.GL_TEXTURE_2D);// w ww.  j ava  2s.  c o  m
    GL11.glEnable(GL11.GL_BLEND);
    glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    color.glColor();
    int x = getAbsoluteX(), y = getAbsoluteY(), w = getWidth(), h = getHeight();
    GL11.glBegin(GL11.GL_TRIANGLE_FAN);
    GL11.glVertex2i(x, y);
    GL11.glVertex2i(x + w, y);
    GL11.glVertex2i(x + w, y + h);
    GL11.glVertex2i(x, y + h);
    GL11.glEnd();
}

From source file:name.martingeisse.stackd.client.gui.element.FillTexture.java

License:Open Source License

@Override
protected void draw() {
    GL11.glEnable(GL11.GL_TEXTURE_2D);//from  w ww. j  a  v a 2 s  .co  m
    GL11.glDisable(GL11.GL_BLEND);
    texture.glBindTexture();
    final int x = getAbsoluteX(), y = getAbsoluteY(), w = getWidth(), h = getHeight();
    final Gui gui = getGui();
    final float effectiveRepetitionLengthX = (repetitionLengthX < 1 ? gui.pixelsToUnitsInt(texture.getWidth())
            : repetitionLengthX);
    final float effectiveRepetitionLengthY = (repetitionLengthY < 1 ? gui.pixelsToUnitsInt(texture.getHeight())
            : repetitionLengthY);
    final float s = (w / effectiveRepetitionLengthX);
    final float t = (h / effectiveRepetitionLengthY);

    GL11.glColor3ub((byte) 255, (byte) 255, (byte) 255);
    GL11.glBegin(GL11.GL_TRIANGLE_FAN);
    GL11.glTexCoord2f(0.0f, 0.0f);
    GL11.glVertex2i(x, y);
    GL11.glTexCoord2f(s, 0.0f);
    GL11.glVertex2i(x + w, y);
    GL11.glTexCoord2f(s, t);
    GL11.glVertex2i(x + w, y + h);
    GL11.glTexCoord2f(0.0f, t);
    GL11.glVertex2i(x, y + h);
    GL11.glEnd();
}