List of usage examples for org.lwjgl.opengl GL11 glPushAttrib
public static native void glPushAttrib(@NativeType("GLbitfield") int mask);
From source file:zeldaswordskills.client.render.item.RenderItemBombBag.java
License:Open Source License
@Override public void renderItem(ItemRenderType type, ItemStack item, Object... data) { if (type == ItemRenderType.INVENTORY) { Tessellator tessellator = Tessellator.instance; GL11.glPushMatrix();// w ww. ja v a 2 s .c o m GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS); GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); zLevel = 50.0F; for (int i = 0; i < 3; ++i) { if (i > 0) { zLevel = 100.0F; } IIcon icon = item.getItem().getIcon(item, i); tessellator.startDrawingQuads(); tessellator.addVertexWithUV(0, 16, zLevel, icon.getMinU(), icon.getMaxV()); tessellator.addVertexWithUV(16, 16, zLevel, icon.getMaxU(), icon.getMaxV()); tessellator.addVertexWithUV(16, 0, zLevel, icon.getMaxU(), icon.getMinV()); tessellator.addVertexWithUV(0, 0, zLevel, icon.getMinU(), icon.getMinV()); tessellator.draw(); } GL11.glPopAttrib(); GL11.glPopMatrix(); } }
From source file:zildo.fwk.opengl.compatibility.FBOHardware.java
License:Open Source License
@Override public void startRendering(int myFBOId, int sizeX, int sizeY) { EXTFramebufferObject.glBindFramebufferEXT(EXTFramebufferObject.GL_FRAMEBUFFER_EXT, myFBOId); GL11.glPushAttrib(GL11.GL_VIEWPORT_BIT); GL11.glViewport(0, 0, Zildo.viewPortX, Zildo.viewPortY); GL11.glClear(GL11.GL_COLOR_BUFFER_BIT); }