List of usage examples for org.lwjgl.opengl GL11 glVertex2i
public static native void glVertex2i(@NativeType("GLint") int x, @NativeType("GLint") int y);
From source file:net.phatcode.rel.multimedia.Graphics.java
License:Open Source License
public void drawBox(int x1, int y1, int x2, int y2) { GL11.glDisable(GL11.GL_TEXTURE_2D);/*w ww .j a v a 2 s .c o m*/ GL11.glBegin(GL11.GL_LINE_STRIP); GL11.glVertex2i(x1, y1); GL11.glVertex2i(x2, y1); GL11.glVertex2i(x2, y2); GL11.glVertex2i(x1, y2); GL11.glVertex2i(x1, y1); GL11.glEnd(); GL11.glEnable(GL11.GL_TEXTURE_2D); }
From source file:net.phatcode.rel.multimedia.Graphics.java
License:Open Source License
public void drawBoxFilled(int x1, int y1, int x2, int y2, float r, float g, float b, float a) { GL11.glDisable(GL11.GL_TEXTURE_2D);//from w w w. jav a 2 s.c o m GL11.glColor4f(r, g, b, a); x2++; y2++; GL11.glBegin(GL11.GL_QUADS); GL11.glVertex2i(x1, y1); GL11.glVertex2i(x1, y2); GL11.glVertex2i(x2, y2); GL11.glVertex2i(x2, y1); GL11.glEnd(); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glColor4f(1, 1, 1, 1); }
From source file:net.phatcode.rel.multimedia.Graphics.java
License:Open Source License
public void drawBoxFilled(int x1, int y1, int x2, int y2) { GL11.glDisable(GL11.GL_TEXTURE_2D);//from w w w .j a v a 2 s . com x2++; y2++; GL11.glBegin(GL11.GL_QUADS); GL11.glVertex2i(x1, y1); GL11.glVertex2i(x1, y2); GL11.glVertex2i(x2, y2); GL11.glVertex2i(x2, y1); GL11.glEnd(); GL11.glEnable(GL11.GL_TEXTURE_2D); }
From source file:org.agpu.oc.common.tileentity.AdvancedMonitor.java
public void swapBuffers(NBTTagCompound tag) { if (worldObj.isRemote) { for (int i = 0; i < tag.getInteger("commands"); i++) { NBTTagCompound t = tag.getCompoundTag(String.valueOf(i)); String type = t.getString("type"); if (type.equals("startDrawing3D")) { startDrawing3D(t.getInteger("x"), t.getInteger("y"), t.getInteger("width"), t.getInteger("height"), t.getFloat("fov"), t.getFloat("zNear"), t.getFloat("zFar")); } else if (type.equals("startDrawing2D")) { startDrawing2D(t.getInteger("x"), t.getInteger("y"), t.getInteger("width"), t.getInteger("height")); } else if (type.equals("setColor")) { GL11.glColor4f(t.getFloat("r"), t.getFloat("g"), t.getFloat("b"), t.getFloat("a")); } else if (type.equals("vertex3f")) { GL11.glVertex3f(t.getFloat("x"), t.getFloat("y"), t.getFloat("z")); } else if (type.equals("vertex2i")) { GL11.glVertex2i(t.getInteger("x"), t.getInteger("y")); } else if (type.equals("translate")) { GL11.glTranslatef(t.getFloat("x"), t.getFloat("y"), t.getFloat("z")); } else if (type.equals("rotate")) { GL11.glRotatef(t.getFloat("angle"), t.getFloat("x"), t.getFloat("y"), t.getFloat("z")); } else if (type.equals("scale")) { GL11.glScalef(t.getFloat("x"), t.getFloat("y"), t.getFloat("z")); } else if (type.equals("begin")) { GL11.glBegin(t.getInteger("m")); } else if (type.equals("end")) { GL11.glEnd();// w ww . j a v a2 s . c o m } else if (type.equals("string")) { Minecraft.getMinecraft().fontRendererObj.drawString(t.getString("string"), t.getInteger("x"), t.getInteger("y"), t.getInteger("color")); } else if (type.equals("enable")) { GL11.glEnable(t.getInteger("v")); } else if (type.equals("disable")) { GL11.glDisable(t.getInteger("v")); } else { System.out.println("Unknown packet type received: " + type); } } GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, 0); GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glPopMatrix(); GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glPopMatrix(); GL11.glPopAttrib(); } }
From source file:org.craftmania.inventory.CraftingTableInventory.java
License:Apache License
@Override public void renderInventory() { if (_inventoryDrawList == -1) { return;//from www . jav a 2s.com } Configuration conf = Game.getInstance().getConfiguration(); GL11.glPushMatrix(); GL11.glTranslatef(conf.getWidth() / 2.0f, conf.getHeight() / 2.0f, 0.0f); _tex.bind(); GL11.glCallList(_inventoryDrawList); GL11.glPopMatrix(); for (int i = 0; i < _raster.getCellCount(); ++i) { GL11.glPushMatrix(); ReadablePoint r = _raster.getCenterOfCell(i); GL11.glTranslatef(r.getX(), r.getY(), 0); if (Mouse.getX() < r.getX() + 16 && Mouse.getX() > r.getX() - 16 && Mouse.getY() < r.getY() + 16 && Mouse.getY() > r.getY() - 16) { GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glColor4f(1.0f, 1.0f, 1.0f, 0.2f); GL11.glBegin(GL11.GL_QUADS); GL11.glVertex2i(-16, -16); GL11.glVertex2i(+16, -16); GL11.glVertex2i(+16, +16); GL11.glVertex2i(-16, +16); GL11.glEnd(); GL11.glColor4f(1.0f, 1.0f, 1.0f, 1.0f); } InventoryPlace place = getInventoryPlace(i); if (place != null) { place.render(); } GL11.glPopMatrix(); } /* Draggin item */ if (_dragging && _draggingItem != null) { GL11.glPushMatrix(); GL11.glTranslatef(Mouse.getX(), Mouse.getY(), 0); _draggingItem.render(); GL11.glPopMatrix(); } }
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 v a 2 s.com 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 w w.j a v a2 s .c o 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; } }
From source file:Src.Framework.Menus.OptionsAudioMenu.java
public static void render() { //bind white before binding any textures Color.white.bind();//from www .j av a 2s . c o 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 audioTitle Color.white.bind(); audioTitle.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(); //musicVolume slider Color.white.bind(); sliderTrack.bind(); GL11.glBegin(GL11.GL_QUADS); GL11.glTexCoord2d(0, 0); GL11.glVertex2i(350, 224); GL11.glTexCoord2d(1, 0); GL11.glVertex2i(606, 224); GL11.glTexCoord2d(1, 1); GL11.glVertex2i(606, 256); GL11.glTexCoord2d(0, 1); GL11.glVertex2i(350, 256); GL11.glEnd(); Color.white.bind(); slider.bind(); GL11.glBegin(GL11.GL_QUADS); GL11.glTexCoord2d(0, 0); GL11.glVertex2i(362 + (int) (220 * Audio.getMusicVolume()), 224); GL11.glTexCoord2d(1, 0); GL11.glVertex2i(370 + (int) (220 * Audio.getMusicVolume()), 224); GL11.glTexCoord2d(1, 1); GL11.glVertex2i(370 + (int) (220 * Audio.getMusicVolume()), 256); GL11.glTexCoord2d(0, 1); GL11.glVertex2i(362 + (int) (220 * Audio.getMusicVolume()), 256); GL11.glEnd(); //effectVolume slider Color.white.bind(); sliderTrack.bind(); GL11.glBegin(GL11.GL_QUADS); GL11.glTexCoord2d(0, 0); GL11.glVertex2i(350, 288); GL11.glTexCoord2d(1, 0); GL11.glVertex2i(606, 288); GL11.glTexCoord2d(1, 1); GL11.glVertex2i(606, 320); GL11.glTexCoord2d(0, 1); GL11.glVertex2i(350, 320); GL11.glEnd(); Color.white.bind(); slider.bind(); GL11.glBegin(GL11.GL_QUADS); GL11.glTexCoord2d(0, 0); GL11.glVertex2i(362 + (int) (220 * Audio.getEffectVolume()), 288); GL11.glTexCoord2d(1, 0); GL11.glVertex2i(370 + (int) (220 * Audio.getEffectVolume()), 288); GL11.glTexCoord2d(1, 1); GL11.glVertex2i(370 + (int) (220 * Audio.getEffectVolume()), 320); GL11.glTexCoord2d(0, 1); GL11.glVertex2i(362 + (int) (220 * Audio.getEffectVolume()), 320); GL11.glEnd(); switch (selection) { case 1: Color.white.bind(); musicVolumeSelected.bind(); GL11.glBegin(GL11.GL_QUADS); GL11.glTexCoord2d(0, 0); GL11.glVertex2i(350, 192); GL11.glTexCoord2d(1, 0); GL11.glVertex2i(606, 192); GL11.glTexCoord2d(1, 1); GL11.glVertex2i(606, 224); GL11.glTexCoord2d(0, 1); GL11.glVertex2i(350, 224); GL11.glEnd(); Color.white.bind(); colonSelected.bind(); GL11.glBegin(GL11.GL_QUADS); GL11.glTexCoord2d(0, 0); GL11.glVertex2i(606, 192); GL11.glTexCoord2d(1, 0); GL11.glVertex2i(622, 192); GL11.glTexCoord2d(1, 1); GL11.glVertex2i(622, 224); GL11.glTexCoord2d(0, 1); GL11.glVertex2i(606, 224); GL11.glEnd(); Color.white.bind(); effectVolume.bind(); GL11.glBegin(GL11.GL_QUADS); GL11.glTexCoord2d(0, 0); GL11.glVertex2i(350, 256); GL11.glTexCoord2d(1, 0); GL11.glVertex2i(606, 256); GL11.glTexCoord2d(1, 1); GL11.glVertex2i(606, 288); GL11.glTexCoord2d(0, 1); GL11.glVertex2i(350, 288); GL11.glEnd(); Color.white.bind(); colon.bind(); GL11.glBegin(GL11.GL_QUADS); GL11.glTexCoord2d(0, 0); GL11.glVertex2i(606, 256); GL11.glTexCoord2d(1, 0); GL11.glVertex2i(622, 256); GL11.glTexCoord2d(1, 1); GL11.glVertex2i(622, 288); GL11.glTexCoord2d(0, 1); GL11.glVertex2i(606, 288); GL11.glEnd(); Color.white.bind(); OptionsMenu.back.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(); musicVolume.bind(); GL11.glBegin(GL11.GL_QUADS); GL11.glTexCoord2d(0, 0); GL11.glVertex2i(350, 192); GL11.glTexCoord2d(1, 0); GL11.glVertex2i(606, 192); GL11.glTexCoord2d(1, 1); GL11.glVertex2i(606, 224); GL11.glTexCoord2d(0, 1); GL11.glVertex2i(350, 224); GL11.glEnd(); Color.white.bind(); colon.bind(); GL11.glBegin(GL11.GL_QUADS); GL11.glTexCoord2d(0, 0); GL11.glVertex2i(606, 192); GL11.glTexCoord2d(1, 0); GL11.glVertex2i(622, 192); GL11.glTexCoord2d(1, 1); GL11.glVertex2i(622, 224); GL11.glTexCoord2d(0, 1); GL11.glVertex2i(606, 224); GL11.glEnd(); Color.white.bind(); effectVolumeSelected.bind(); GL11.glBegin(GL11.GL_QUADS); GL11.glTexCoord2d(0, 0); GL11.glVertex2i(350, 256); GL11.glTexCoord2d(1, 0); GL11.glVertex2i(606, 256); GL11.glTexCoord2d(1, 1); GL11.glVertex2i(606, 288); GL11.glTexCoord2d(0, 1); GL11.glVertex2i(350, 288); GL11.glEnd(); Color.white.bind(); colonSelected.bind(); GL11.glBegin(GL11.GL_QUADS); GL11.glTexCoord2d(0, 0); GL11.glVertex2i(606, 256); GL11.glTexCoord2d(1, 0); GL11.glVertex2i(622, 256); GL11.glTexCoord2d(1, 1); GL11.glVertex2i(622, 288); GL11.glTexCoord2d(0, 1); GL11.glVertex2i(606, 288); GL11.glEnd(); Color.white.bind(); OptionsMenu.back.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(); musicVolume.bind(); GL11.glBegin(GL11.GL_QUADS); GL11.glTexCoord2d(0, 0); GL11.glVertex2i(350, 192); GL11.glTexCoord2d(1, 0); GL11.glVertex2i(606, 192); GL11.glTexCoord2d(1, 1); GL11.glVertex2i(606, 224); GL11.glTexCoord2d(0, 1); GL11.glVertex2i(350, 224); GL11.glEnd(); Color.white.bind(); colon.bind(); GL11.glBegin(GL11.GL_QUADS); GL11.glTexCoord2d(0, 0); GL11.glVertex2i(606, 192); GL11.glTexCoord2d(1, 0); GL11.glVertex2i(622, 192); GL11.glTexCoord2d(1, 1); GL11.glVertex2i(622, 224); GL11.glTexCoord2d(0, 1); GL11.glVertex2i(606, 224); GL11.glEnd(); Color.white.bind(); effectVolume.bind(); GL11.glBegin(GL11.GL_QUADS); GL11.glTexCoord2d(0, 0); GL11.glVertex2i(350, 256); GL11.glTexCoord2d(1, 0); GL11.glVertex2i(606, 256); GL11.glTexCoord2d(1, 1); GL11.glVertex2i(606, 288); GL11.glTexCoord2d(0, 1); GL11.glVertex2i(350, 288); GL11.glEnd(); Color.white.bind(); colon.bind(); GL11.glBegin(GL11.GL_QUADS); GL11.glTexCoord2d(0, 0); GL11.glVertex2i(606, 256); GL11.glTexCoord2d(1, 0); GL11.glVertex2i(622, 256); GL11.glTexCoord2d(1, 1); GL11.glVertex2i(622, 288); GL11.glTexCoord2d(0, 1); GL11.glVertex2i(606, 288); GL11.glEnd(); Color.white.bind(); OptionsMenu.backSelected.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; } }
From source file:Src.Framework.Menus.OptionsMenu.java
public static void render() { //bind white before binding any textures Color.white.bind();/*from w w w . j a va 2 s. c o 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 optionsTitle Color.white.bind(); optionsTitle.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(); generalSelected.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(); controls.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(); video.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(); audio.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(); back.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(); general.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(); controlsSelected.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(); video.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(); audio.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(); back.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(); general.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(); controls.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(); videoSelected.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(); audio.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(); back.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(); general.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(); controls.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(); video.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(); audioSelected.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(); back.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(); general.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(); controls.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(); video.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(); audio.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(); backSelected.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; } }
From source file:thaumic.tinkerer.client.gui.kami.GuiWarpGateDestinations.java
License:Creative Commons License
@Override public void drawScreen(int par1, int par2, float par3) { drawDefaultBackground();//from w ww. j a v a 2 s .c om super.drawScreen(par1, par2, par3); tooltip.clear(); int gateX = warpGate.xCoord - x; int gateY = warpGate.zCoord - y; mc.renderEngine.bindTexture(TextureMap.locationItemsTexture); List<Object[]> coords = new ArrayList(); for (int i = 0; i < warpGate.getSizeInventory(); i++) { ItemStack stack = warpGate.getStackInSlot(i); if (stack != null && ItemSkyPearl.isAttuned(stack)) { int dim = ItemSkyPearl.getDim(stack); if (warpGate.getWorldObj().provider.dimensionId != dim) continue; int x = ItemSkyPearl.getX(stack); int y = ItemSkyPearl.getY(stack); int z = ItemSkyPearl.getZ(stack); if (y != -1) coords.add(new Object[] { x - this.x, z - this.y, stack, i }); } } GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColor4f(1F, 1F, 1F, (float) ((Math.sin(ticks / 10D) + 1F) / 4F + 0.25F)); GL11.glLineWidth(2F); GL11.glDisable(GL11.GL_TEXTURE_2D); for (Object[] coords_ : coords) { int x = (Integer) coords_[0]; int y = (Integer) coords_[1]; GL11.glBegin(GL11.GL_LINES); GL11.glVertex2i(gateX, gateY); GL11.glVertex2i(x, y); GL11.glEnd(); } GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_BLEND); fontRendererObj.drawStringWithShadow( EnumChatFormatting.UNDERLINE + StatCollector.translateToLocal("ttmisc.destinations"), 3, 40, 0xFFFFFF); GL11.glColor4f(1F, 1F, 1F, 1F); drawPearlAt(0, null, gateX, gateY, par1, par2); for (Object[] coords_ : coords) drawPearlAt((Integer) coords_[3], (ItemStack) coords_[2], (Integer) coords_[0], (Integer) coords_[1], par1, par2); if (!tooltip.isEmpty()) ClientHelper.renderTooltip(par1, par2, tooltip); drawCenteredString(fontRendererObj, StatCollector.translateToLocal("ttmisc.numberKeys"), width / 2, 5, 0xFFFFFF); drawCenteredString(fontRendererObj, StatCollector.translateToLocal("ttmisc.spaceToReset"), width / 2, 16, 0xFFFFFF); }