List of usage examples for org.lwjgl.opengl GL11 glVertex2f
public static native void glVertex2f(@NativeType("GLfloat") float x, @NativeType("GLfloat") float y);
From source file:io.flob.blackheart.Button.java
License:Open Source License
private void render() { if (!active) { GL11.glColor3d(0.25f, 0.25f, 0.25f); } else if (selected()) { GL11.glColor3d(0.75f, 0.75f, 0.75f); }//from ww w . j a v a 2 s . c om GL11.glTexCoord2f(_texture.getU(), _texture.getV()); GL11.glVertex2f(position.getX(), position.getY()); GL11.glTexCoord2f(_texture.getU2(), _texture.getV()); GL11.glVertex2f(position.getX() + (size.getX()), position.getY()); GL11.glTexCoord2f(_texture.getU2(), _texture.getV2()); GL11.glVertex2f(position.getX() + (size.getX()), position.getY() + (size.getY())); GL11.glTexCoord2f(_texture.getU(), _texture.getV2()); GL11.glVertex2f(position.getX(), position.getY() + (size.getY())); GL11.glColor3d(1, 1, 1); }
From source file:io.flob.blackheart.CollectableGold.java
License:Open Source License
@Override public void _render() { GL11.glEnd();//from w w w. j av a 2s . c om GL11.glPushMatrix(); GL11.glTranslatef(position().getX(), position().getY(), position().getZ()); FloatBuffer modelview = BufferUtils.createFloatBuffer(16); GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, modelview); for (int i = 0; i < 3; i += 2) { for (int j = 0; j < 3; j++) { if (i == j) { modelview.put(i * 4 + j, 1.0f); } else { modelview.put(i * 4 + j, 0.0f); } } } GL11.glLoadMatrix(modelview); GL11.glBegin(GL11.GL_QUADS); GL11.glNormal3f(0f, 0f, 1f); GL11.glTexCoord2f(_texture[state].getU(), _texture[state].getV2()); GL11.glVertex2f(-size(), -size()); GL11.glTexCoord2f(_texture[state].getU2(), _texture[state].getV2()); GL11.glVertex2f(size(), -size()); GL11.glTexCoord2f(_texture[state].getU2(), _texture[state].getV()); GL11.glVertex2f(size(), size()); GL11.glTexCoord2f(_texture[state].getU(), _texture[state].getV()); GL11.glVertex2f(-size(), size()); GL11.glEnd(); GL11.glPopMatrix(); GL11.glBegin(GL11.GL_QUADS); }
From source file:io.flob.blackheart.ICollectable.java
License:Open Source License
@Override public void _render() { GL11.glEnd();//from w ww .j a v a 2 s.co m if (texture == null) { texture = TextureLibrary.placeholder; } GL11.glPushMatrix(); GL11.glTranslatef(position.getX(), position.getY(), position.getZ()); FloatBuffer modelview = BufferUtils.createFloatBuffer(16); GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, modelview); for (int i = 0; i < 3; i += 2) { for (int j = 0; j < 3; j++) { if (i == j) { modelview.put(i * 4 + j, 1.0f); } else { modelview.put(i * 4 + j, 0.0f); } } } GL11.glLoadMatrix(modelview); GL11.glBegin(GL11.GL_QUADS); GL11.glNormal3f(0f, 0f, 1f); GL11.glTexCoord2f(texture.getU(), texture.getV2()); GL11.glVertex2f(-size, -size); GL11.glTexCoord2f(texture.getU2(), texture.getV2()); GL11.glVertex2f(size, -size); GL11.glTexCoord2f(texture.getU2(), texture.getV()); GL11.glVertex2f(size, size); GL11.glTexCoord2f(texture.getU(), texture.getV()); GL11.glVertex2f(-size, size); GL11.glEnd(); GL11.glPopMatrix(); GL11.glBegin(GL11.GL_QUADS); }
From source file:io.flob.blackheart.MobMachinegun.java
License:Open Source License
@Override public void _render() { GL11.glEnd();//from w w w . j a v a2 s .co m float size_x = size().getX() / 2f; float size_y = size().getY() / 2f + 0.025f; // HARD SET! GL11.glPushMatrix(); GL11.glTranslatef(position().getX(), position().getY(), position().getZ()); FloatBuffer modelview = BufferUtils.createFloatBuffer(16); GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, modelview); for (int i = 0; i < 3; i += 2) { for (int j = 0; j < 3; j++) { if (i == j) { modelview.put(i * 4 + j, 1.0f); } else { modelview.put(i * 4 + j, 0.0f); } } } GL11.glLoadMatrix(modelview); GL11.glBegin(GL11.GL_QUADS); GL11.glNormal3f(0f, 0f, 1f); GL11.glTexCoord2f(texture[state].getU(), texture[state].getV2()); GL11.glVertex2f(-size_x, -size_y); GL11.glTexCoord2f(texture[state].getU2(), texture[state].getV2()); GL11.glVertex2f(size_x, -size_y); GL11.glTexCoord2f(texture[state].getU2(), texture[state].getV()); GL11.glVertex2f(size_x, size_y); GL11.glTexCoord2f(texture[state].getU(), texture[state].getV()); GL11.glVertex2f(-size_x, size_y); GL11.glEnd(); GL11.glPopMatrix(); GL11.glBegin(GL11.GL_QUADS); }
From source file:io.flob.blackheart.StateGameDead.java
License:Open Source License
@Override public void tick() throws Exception { _core._input.mouse(false);// ww w. j a va2 s.c o m _core._texture.game_atlas.bind(); _core._game._level._render(); _core._display.mode_2D(); GL11.glBegin(GL11.GL_QUADS); GL11.glTexCoord2f(texture_background.getU(), texture_background.getV()); GL11.glVertex2f(0, 0); GL11.glTexCoord2f(texture_background.getU2(), texture_background.getV()); GL11.glVertex2f(_core._display.width(), 0); GL11.glTexCoord2f(texture_background.getU2(), texture_background.getV2()); GL11.glVertex2f(_core._display.width(), _core._display.height()); GL11.glTexCoord2f(texture_background.getU(), texture_background.getV2()); GL11.glVertex2f(0, _core._display.height()); button_tryagain.tick(); GL11.glEnd(); _core._font.button.render_centred((int) button_tryagain.getCenterX(), (int) button_tryagain.getCenterY(), button_tryagain_text); // Title _core._font.title.render_centred(_core._display.width() / 2, 80, title_text); _core._display.mode_3D(); if (button_tryagain.clicked()) { Mouse.setCursorPosition((int) (button_tryagain.getX() + (button_tryagain.width() / 2)), (int) (button_tryagain.getY() - button_tryagain.height())); _core._game._level.reload(); } }
From source file:io.flob.blackheart.StateGameLevelComplete.java
License:Open Source License
private void render_background() { GL11.glBegin(GL11.GL_QUADS);/* w ww.j a v a 2s .com*/ GL11.glTexCoord2f(texture_background.getU(), texture_background.getV()); GL11.glVertex2f(0, 0); GL11.glTexCoord2f(texture_background.getU2(), texture_background.getV()); GL11.glVertex2f(_core._display.width(), 0); GL11.glTexCoord2f(texture_background.getU2(), texture_background.getV2()); GL11.glVertex2f(_core._display.width(), _core._display.height()); GL11.glTexCoord2f(texture_background.getU(), texture_background.getV2()); GL11.glVertex2f(0, _core._display.height()); }
From source file:io.flob.clicker.Button.java
License:Open Source License
private void render() { if (selected()) { GL11.glColor3d(0.75f, 0.75f, 0.75f); }// www .j av a 2 s. c o m GL11.glTexCoord2f(_texture.getU(), _texture.getV()); GL11.glVertex2f(position.getX(), position.getY()); GL11.glTexCoord2f(_texture.getU2(), _texture.getV()); GL11.glVertex2f(position.getX() + (size.getX()), position.getY()); GL11.glTexCoord2f(_texture.getU2(), _texture.getV2()); GL11.glVertex2f(position.getX() + (size.getX()), position.getY() + (size.getY())); GL11.glTexCoord2f(_texture.getU(), _texture.getV2()); GL11.glVertex2f(position.getX(), position.getY() + (size.getY())); GL11.glColor3d(1, 1, 1); }
From source file:io.github.minecraftgui.controllers.Render.java
License:Open Source License
public void drawCustomPolygon(int[] x, int[] y, Color color) { if (color.getAlpha() != 0 && x.length == y.length) { GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_BLEND);//from w ww . j a v a 2 s. co m GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColor4f((color.getRed() / 255.0f), (color.getGreen() / 255.0f), (color.getBlue() / 255.0f), (color.getAlpha() / 255.0f)); GL11.glBegin(GL11.GL_LINES); { for (int i = 0; i < x.length; i++) { if (i < x.length - 1) { GL11.glVertex2f(x[i], y[i]); GL11.glVertex2f(x[i + 1], y[i + 1]); } else { GL11.glVertex2f(x[i], y[i]); GL11.glVertex2f(x[0], y[0]); } } } GL11.glEnd(); GL11.glEnable(GL11.GL_TEXTURE_2D); } }
From source file:io.github.minecraftgui.controllers.Render.java
License:Open Source License
public void drawLine(int x0, int y0, int x1, int y1, Color color) { if (color.getAlpha() != 0) { GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_BLEND);/* ww w. j a v a 2 s . c om*/ GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColor4f((color.getRed() / 255.0f), (color.getGreen() / 255.0f), (color.getBlue() / 255.0f), (color.getAlpha() / 255.0f)); GL11.glBegin(GL11.GL_LINES); { GL11.glVertex2f(x0, y0); GL11.glVertex2f(x1, y1); } GL11.glEnd(); GL11.glEnable(GL11.GL_TEXTURE_2D); } }
From source file:io.root.gfx.glutils.GL.java
License:Apache License
public static void glVertex2f(float x, float y) { GL11.glVertex2f(x, y); }