List of usage examples for org.lwjgl.opengl GL11 glTranslated
public static native void glTranslated(@NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z);
From source file:appeng.parts.misc.PartToggleBus.java
License:Open Source License
@Override @SideOnly(Side.CLIENT)/*from w w w . j a v a 2 s .c o m*/ public void renderInventory(final IPartRenderHelper rh, final RenderBlocks renderer) { GL11.glTranslated(-0.2, -0.3, 0.0); rh.setTexture(this.getItemStack().getIconIndex()); rh.setBounds(6, 6, 14 - 4, 10, 10, 16 - 4); rh.renderInventoryBox(renderer); rh.setBounds(6, 6, 11 - 4, 10, 10, 13 - 4); rh.renderInventoryBox(renderer); rh.setBounds(6, 6, 13 - 4, 10, 10, 14 - 4); rh.setTexture(CableBusTextures.PartMonitorSidesStatus.getIcon()); rh.renderInventoryBox(renderer); rh.setTexture(CableBusTextures.PartMonitorSidesStatusLights.getIcon()); rh.setInvColor(0x000000); rh.renderInventoryBox(renderer); rh.setInvColor(0xffffff); rh.setTexture(null); }
From source file:appeng.parts.networking.PartCable.java
License:Open Source License
@Override @SideOnly(Side.CLIENT)/*from w w w .ja va 2s .c om*/ public void renderInventory(final IPartRenderHelper rh, final RenderBlocks renderer) { GL11.glTranslated(-0.0, -0.0, 0.3); rh.setTexture(this.getTexture(this.getCableColor())); rh.setBounds(6.0f, 6.0f, 2.0f, 10.0f, 10.0f, 14.0f); rh.renderInventoryBox(renderer); rh.setTexture(null); }
From source file:appeng.parts.networking.PartCableCovered.java
License:Open Source License
@Override @SideOnly(Side.CLIENT)/*from w w w . j ava 2 s. c o m*/ public void renderInventory(final IPartRenderHelper rh, final RenderBlocks renderer) { GL11.glTranslated(-0.0, -0.0, 0.3); rh.setBounds(5.0f, 5.0f, 2.0f, 11.0f, 11.0f, 14.0f); float offU = 0; float offV = 9; OffsetIcon main = new OffsetIcon(this.getTexture(this.getCableColor()), offU, offV); for (final ForgeDirection side : EnumSet.of(ForgeDirection.UP, ForgeDirection.DOWN)) { rh.renderInventoryFace(main, side, renderer); } offU = 9; offV = 0; main = new OffsetIcon(this.getTexture(this.getCableColor()), offU, offV); for (final ForgeDirection side : EnumSet.of(ForgeDirection.EAST, ForgeDirection.WEST)) { rh.renderInventoryFace(main, side, renderer); } main = new OffsetIcon(this.getTexture(this.getCableColor()), 0, 0); for (final ForgeDirection side : EnumSet.of(ForgeDirection.SOUTH, ForgeDirection.NORTH)) { rh.renderInventoryFace(main, side, renderer); } rh.setTexture(null); }
From source file:appeng.parts.networking.PartCableSmart.java
License:Open Source License
@Override @SideOnly(Side.CLIENT)//from w w w .j a va2 s . co m public void renderInventory(final IPartRenderHelper rh, final RenderBlocks renderer) { GL11.glTranslated(-0.0, -0.0, 0.3); float offU = 0; float offV = 9; OffsetIcon main = new OffsetIcon(this.getTexture(this.getCableColor()), offU, offV); OffsetIcon ch1 = new OffsetIcon(this.getChannelTex(4, false).getIcon(), offU, offV); OffsetIcon ch2 = new OffsetIcon(this.getChannelTex(4, true).getIcon(), offU, offV); for (final ForgeDirection side : EnumSet.of(ForgeDirection.UP, ForgeDirection.DOWN)) { rh.setBounds(5.0f, 5.0f, 2.0f, 11.0f, 11.0f, 14.0f); rh.renderInventoryFace(main, side, renderer); rh.renderInventoryFace(ch1, side, renderer); rh.renderInventoryFace(ch2, side, renderer); } offU = 9; offV = 0; main = new OffsetIcon(this.getTexture(this.getCableColor()), offU, offV); ch1 = new OffsetIcon(this.getChannelTex(4, false).getIcon(), offU, offV); ch2 = new OffsetIcon(this.getChannelTex(4, true).getIcon(), offU, offV); for (final ForgeDirection side : EnumSet.of(ForgeDirection.EAST, ForgeDirection.WEST)) { rh.setBounds(5.0f, 5.0f, 2.0f, 11.0f, 11.0f, 14.0f); rh.renderInventoryFace(main, side, renderer); rh.renderInventoryFace(ch1, side, renderer); rh.renderInventoryFace(ch2, side, renderer); } main = new OffsetIcon(this.getTexture(this.getCableColor()), 0, 0); ch1 = new OffsetIcon(this.getChannelTex(4, false).getIcon(), 0, 0); ch2 = new OffsetIcon(this.getChannelTex(4, true).getIcon(), 0, 0); for (final ForgeDirection side : EnumSet.of(ForgeDirection.SOUTH, ForgeDirection.NORTH)) { rh.setBounds(5.0f, 5.0f, 2.0f, 11.0f, 11.0f, 14.0f); rh.renderInventoryFace(main, side, renderer); rh.renderInventoryFace(ch1, side, renderer); rh.renderInventoryFace(ch2, side, renderer); } rh.setTexture(null); }
From source file:appeng.parts.networking.PartDenseCable.java
License:Open Source License
@Override @SideOnly(Side.CLIENT)// w w w .jav a 2s. c o m public void renderInventory(final IPartRenderHelper rh, final RenderBlocks renderer) { GL11.glTranslated(-0.0, -0.0, 0.3); rh.setBounds(4.0f, 4.0f, 2.0f, 12.0f, 12.0f, 14.0f); float offU = 0; float offV = 9; OffsetIcon main = new OffsetIcon(this.getTexture(this.getCableColor()), offU, offV); OffsetIcon ch1 = new OffsetIcon(this.getChannelTex(4, false).getIcon(), offU, offV); OffsetIcon ch2 = new OffsetIcon(this.getChannelTex(4, true).getIcon(), offU, offV); for (final ForgeDirection side : EnumSet.of(ForgeDirection.UP, ForgeDirection.DOWN)) { rh.renderInventoryFace(main, side, renderer); rh.renderInventoryFace(ch1, side, renderer); rh.renderInventoryFace(ch2, side, renderer); } offU = 9; offV = 0; main = new OffsetIcon(this.getTexture(this.getCableColor()), offU, offV); ch1 = new OffsetIcon(this.getChannelTex(4, false).getIcon(), offU, offV); ch2 = new OffsetIcon(this.getChannelTex(4, true).getIcon(), offU, offV); for (final ForgeDirection side : EnumSet.of(ForgeDirection.EAST, ForgeDirection.WEST)) { rh.renderInventoryFace(main, side, renderer); rh.renderInventoryFace(ch1, side, renderer); rh.renderInventoryFace(ch2, side, renderer); } main = new OffsetIcon(this.getTexture(this.getCableColor()), 0, 0); ch1 = new OffsetIcon(this.getChannelTex(4, false).getIcon(), 0, 0); ch2 = new OffsetIcon(this.getChannelTex(4, true).getIcon(), 0, 0); for (final ForgeDirection side : EnumSet.of(ForgeDirection.SOUTH, ForgeDirection.NORTH)) { rh.renderInventoryFace(main, side, renderer); rh.renderInventoryFace(ch1, side, renderer); rh.renderInventoryFace(ch2, side, renderer); } rh.setTexture(null); }
From source file:appeng.parts.networking.PartQuartzFiber.java
License:Open Source License
@Override @SideOnly(Side.CLIENT)//from www. jav a2 s . c o m public void renderInventory(final IPartRenderHelper rh, final RenderBlocks renderer) { GL11.glTranslated(-0.2, -0.3, 0.0); rh.setTexture(this.getItemStack().getIconIndex()); rh.setBounds(6.0f, 6.0f, 5.0f, 10.0f, 10.0f, 11.0f); rh.renderInventoryBox(renderer); rh.setTexture(null); }
From source file:appeng.parts.reporting.AbstractPartMonitor.java
License:Open Source License
@Override @SideOnly(Side.CLIENT)//from w w w.j av a 2 s.c om public void renderDynamic(final double x, final double y, final double z, final IPartRenderHelper rh, final RenderBlocks renderer) { if (this.dspList == null) { this.dspList = GLAllocation.generateDisplayLists(1); } final Tessellator tess = Tessellator.instance; if ((this.getClientFlags() & (PartPanel.POWERED_FLAG | PartPanel.CHANNEL_FLAG)) != (PartPanel.POWERED_FLAG | PartPanel.CHANNEL_FLAG)) { return; } final IAEItemStack ais = (IAEItemStack) this.getDisplayed(); if (ais != null) { GL11.glPushMatrix(); GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5); if (this.updateList) { this.updateList = false; GL11.glNewList(this.dspList, GL11.GL_COMPILE_AND_EXECUTE); this.tesrRenderScreen(tess, ais); GL11.glEndList(); } else { GL11.glCallList(this.dspList); } GL11.glPopMatrix(); } }
From source file:appeng.parts.reporting.AbstractPartMonitor.java
License:Open Source License
private void tesrRenderScreen(final Tessellator tess, final IAEItemStack ais) { // GL11.glPushAttrib( GL11.GL_ALL_ATTRIB_BITS ); final ForgeDirection d = this.getSide(); GL11.glTranslated(d.offsetX * 0.77, d.offsetY * 0.77, d.offsetZ * 0.77); switch (d) {//from w w w .ja v a 2 s . c o m case UP: GL11.glScalef(1.0f, -1.0f, 1.0f); GL11.glRotatef(90.0f, 1.0f, 0.0f, 0.0f); GL11.glRotatef(this.getSpin() * 90.0F, 0, 0, 1); break; case DOWN: GL11.glScalef(1.0f, -1.0f, 1.0f); GL11.glRotatef(-90.0f, 1.0f, 0.0f, 0.0f); GL11.glRotatef(this.getSpin() * -90.0F, 0, 0, 1); break; case EAST: GL11.glScalef(-1.0f, -1.0f, -1.0f); GL11.glRotatef(-90.0f, 0.0f, 1.0f, 0.0f); break; case WEST: GL11.glScalef(-1.0f, -1.0f, -1.0f); GL11.glRotatef(90.0f, 0.0f, 1.0f, 0.0f); break; case NORTH: GL11.glScalef(-1.0f, -1.0f, -1.0f); break; case SOUTH: GL11.glScalef(-1.0f, -1.0f, -1.0f); GL11.glRotatef(180.0f, 0.0f, 1.0f, 0.0f); break; default: break; } try { final ItemStack sis = ais.getItemStack(); sis.stackSize = 1; final int br = 16 << 20 | 16 << 4; final int var11 = br % 65536; final int var12 = br / 65536; OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, var11 * 0.8F, var12 * 0.8F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL12.GL_RESCALE_NORMAL); // RenderHelper.enableGUIStandardItemLighting(); tess.setColorOpaque_F(1.0f, 1.0f, 1.0f); ClientHelper.proxy.doRenderItem(sis, this.getTile().getWorldObj()); } catch (final Exception e) { AELog.error(e); } finally { GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL12.GL_RESCALE_NORMAL); } GL11.glTranslatef(0.0f, 0.14f, -0.24f); GL11.glScalef(1.0f / 62.0f, 1.0f / 62.0f, 1.0f / 62.0f); final long stackSize = ais.getStackSize(); final String renderedStackSize = NUMBER_CONVERTER.toWideReadableForm(stackSize); final FontRenderer fr = Minecraft.getMinecraft().fontRenderer; final int width = fr.getStringWidth(renderedStackSize); GL11.glTranslatef(-0.5f * width, 0.0f, -1.0f); fr.drawString(renderedStackSize, 0, 0, 0); // GL11.glPopAttrib(); }
From source file:appeng.parts.reporting.PartStorageMonitor.java
License:Open Source License
@Override @SideOnly(Side.CLIENT)// w w w. j a va 2s . c o m public void renderDynamic(double x, double y, double z, IPartRenderHelper rh, RenderBlocks renderer) { if (this.dspList == null) { this.dspList = GLAllocation.generateDisplayLists(1); } Tessellator tess = Tessellator.instance; if ((this.clientFlags & (this.POWERED_FLAG | this.CHANNEL_FLAG)) != (this.POWERED_FLAG | this.CHANNEL_FLAG)) { return; } IAEItemStack ais = (IAEItemStack) this.getDisplayed(); if (ais != null) { GL11.glPushMatrix(); GL11.glTranslated(x + 0.5, y + 0.5, z + 0.5); if (this.updateList) { this.updateList = false; GL11.glNewList(this.dspList, GL11.GL_COMPILE_AND_EXECUTE); this.tesrRenderScreen(tess, ais); GL11.glEndList(); } else { GL11.glCallList(this.dspList); } GL11.glPopMatrix(); } }
From source file:appeng.parts.reporting.PartStorageMonitor.java
License:Open Source License
private void tesrRenderScreen(Tessellator tess, IAEItemStack ais) { GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS); ForgeDirection d = this.side; GL11.glTranslated(d.offsetX * 0.77, d.offsetY * 0.77, d.offsetZ * 0.77); if (d == ForgeDirection.UP) { GL11.glScalef(1.0f, -1.0f, 1.0f); GL11.glRotatef(90.0f, 1.0f, 0.0f, 0.0f); GL11.glRotatef(this.spin * 90.0F, 0, 0, 1); }/*from www . ja v a 2 s . c o m*/ if (d == ForgeDirection.DOWN) { GL11.glScalef(1.0f, -1.0f, 1.0f); GL11.glRotatef(-90.0f, 1.0f, 0.0f, 0.0f); GL11.glRotatef(this.spin * -90.0F, 0, 0, 1); } if (d == ForgeDirection.EAST) { GL11.glScalef(-1.0f, -1.0f, -1.0f); GL11.glRotatef(-90.0f, 0.0f, 1.0f, 0.0f); } if (d == ForgeDirection.WEST) { GL11.glScalef(-1.0f, -1.0f, -1.0f); GL11.glRotatef(90.0f, 0.0f, 1.0f, 0.0f); } if (d == ForgeDirection.NORTH) { GL11.glScalef(-1.0f, -1.0f, -1.0f); } if (d == ForgeDirection.SOUTH) { GL11.glScalef(-1.0f, -1.0f, -1.0f); GL11.glRotatef(180.0f, 0.0f, 1.0f, 0.0f); } GL11.glPushMatrix(); try { ItemStack sis = ais.getItemStack(); sis.stackSize = 1; int br = 16 << 20 | 16 << 4; int var11 = br % 65536; int var12 = br / 65536; OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, var11 * 0.8F, var12 * 0.8F); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL12.GL_RESCALE_NORMAL); // RenderHelper.enableGUIStandardItemLighting(); tess.setColorOpaque_F(1.0f, 1.0f, 1.0f); ClientHelper.proxy.doRenderItem(sis, this.tile.getWorldObj()); } catch (Exception e) { AELog.error(e); } GL11.glPopMatrix(); GL11.glTranslatef(0.0f, 0.14f, -0.24f); GL11.glScalef(1.0f / 62.0f, 1.0f / 62.0f, 1.0f / 62.0f); final long stackSize = ais.getStackSize(); final String renderedStackSize = NUMBER_CONVERTER.toWideReadableForm(stackSize); FontRenderer fr = Minecraft.getMinecraft().fontRenderer; int width = fr.getStringWidth(renderedStackSize); GL11.glTranslatef(-0.5f * width, 0.0f, -1.0f); fr.drawString(renderedStackSize, 0, 0, 0); GL11.glPopAttrib(); }