protected void drawGuiSlot( GuiCustomSlot slot, int mouseX, int mouseY, float partialTicks ) { if( slot.isSlotEnabled() ) { final int left = slot.xPos(); final int top = slot.yPos(); final int right = left + slot.getWidth(); final int bottom = top + slot.getHeight(); slot.drawContent( this.mc, mouseX, mouseY, partialTicks ); if( this.isPointInRegion( left, top, slot.getWidth(), slot.getHeight(), mouseX, mouseY ) && slot.canClick( this.mc.player ) ) { GlStateManager.disableLighting(); GlStateManager.colorMask( true, true, true, false ); this.drawGradientRect( left, top, right, bottom, -2130706433, -2130706433 ); GlStateManager.colorMask( true, true, true, true ); GlStateManager.enableLighting(); } } }
GlStateManager.colorMask(false, false, false, false); GlStateManager.depthMask(false); GL11.glStencilFunc(GL11.GL_NEVER, 1, 0xFF); GlStateManager.enableBlend(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.colorMask(true, true, true, true); GlStateManager.depthMask(true); GL11.glStencilMask(0x00);
/** * Matches the highlight code in {@link GuiContainer#drawScreen(int, int, float)} */ public void drawHighlight() { GlStateManager.disableLighting(); GlStateManager.disableDepth(); GlStateManager.colorMask(true, true, true, false); GuiUtils.drawGradientRect(0, area.x, area.y, area.x + area.width, area.y + area.height, 0x80FFFFFF, 0x80FFFFFF); GlStateManager.colorMask(true, true, true, true); GlStateManager.enableDepth(); }
public void clear() { GlStateManager.colorMask(true, true, true, true); GlStateManager.clearColor(255.0f, 0, 0, 0); GlStateManager.clear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); }
protected void drawFakeItemHover(int x, int y) { GlStateManager.disableLighting(); GlStateManager.disableDepth(); GlStateManager.colorMask(true, true, true, false); drawGradientRect(x, y, x + 16, y + 16, 0x80FFFFFF, 0x80FFFFFF); GlStateManager.colorMask(true, true, true, true); GlStateManager.enableDepth(); GlStateManager.enableLighting(); }
@Override public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) { WizardryJEIPlugin.fireCategory.flame.draw(minecraft, 30, 14); if (mouseX >= 30 && mouseX <= 30 + 16 && mouseY >= 14 && mouseY <= 14 + 16) { GlStateManager.disableLighting(); GlStateManager.disableDepth(); GlStateManager.colorMask(true, true, true, false); drawGradientRect(30, 14, 30 + 16, 14 + 16); GlStateManager.colorMask(true, true, true, true); GlStateManager.enableLighting(); GlStateManager.enableDepth(); } } }
public static void endStencil() { glStencilFunc(GL_EQUAL, 1, 0xFF); // Pass test if stencil value is 1 glStencilMask(0x00); // Don't write anything to stencil buffer GlStateManager.depthMask(true); // Write to depth buffer GlStateManager.colorMask(true, true, true, false); glDisable(GL_STENCIL_TEST); }
public static void beginDepthMasking() { GlStateManager.enableTexture2D(); GlStateManager.depthMask(false); GlStateManager.colorMask(true, true, true, true); GlStateManager.enableDepth(); GlStateManager.depthFunc(GL11.GL_GREATER); }
@Override public void drawScreen(int x, int y, float partialTicks) { drawDefaultBackground(); super.drawScreen(x, y, partialTicks); int ox = x - guiLeft, oy = y - guiTop; if (ox >= SWAP.x && ox < SWAP.x + 16 && oy >= SWAP.y && oy < SWAP.y + 16) { GlStateManager.disableLighting(); GlStateManager.disableDepth(); GlStateManager.colorMask(true, true, true, false); drawGradientRect(guiLeft + SWAP.x, guiTop + SWAP.y, guiLeft + SWAP.x + 16, guiTop + SWAP.y + 16, -2130706433, -2130706433); GlStateManager.colorMask(true, true, true, true); GlStateManager.enableLighting(); GlStateManager.enableDepth(); drawHoveringText(Collections.singletonList(Helpers.translateToLocal(peripherals ? "gui.plethora.neuralInterface.modules" : "gui.plethora.neuralInterface.peripherals" )), x, y); } renderHoveredToolTip(x, y); }
public static void beginStencil() { glEnable(GL_STENCIL_TEST); GlStateManager.colorMask(false, false, false, false); GlStateManager.depthMask(false); glStencilFunc(GL_ALWAYS, 1, 0xFF); // Set any stencil to 1 glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE); glStencilMask(0xFF); // Write to stencil buffer GlStateManager.clear(GL_STENCIL_BUFFER_BIT); }
public static void beginDrawingDepthMask() { GlStateManager.clear(GL_DEPTH_BUFFER_BIT); GlStateManager.clearDepth(1f); GlStateManager.depthFunc(GL_LESS); GlStateManager.enableDepth(); GlStateManager.depthMask(true); GlStateManager.colorMask(false, false, false, false); GlStateManager.disableTexture2D(); }
public static void renderGhostModel( final IBakedModel baked, final World worldObj, final BlockPos blockPos, final boolean isUnplaceable ) { final int alpha = isUnplaceable ? 0x22000000 : 0xaa000000; GlStateManager.bindTexture( Minecraft.getMinecraft().getTextureMapBlocks().getGlTextureId() ); GlStateManager.color( 1.0f, 1.0f, 1.0f, 1.0f ); GlStateManager.enableBlend(); GlStateManager.enableTexture2D(); GlStateManager.blendFunc( GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA ); GlStateManager.colorMask( false, false, false, false ); RenderHelper.renderModel( baked, worldObj, blockPos, alpha ); GlStateManager.colorMask( true, true, true, true ); GlStateManager.depthFunc( GL11.GL_LEQUAL ); RenderHelper.renderModel( baked, worldObj, blockPos, alpha ); GlStateManager.disableBlend(); }
private void beginMask() { GlStateManager.pushMatrix(); GlStateManager.clear(GL_DEPTH_BUFFER_BIT); GlStateManager.clearDepth(1f); GlStateManager.depthFunc(GL11.GL_LESS); GlStateManager.enableDepth(); GlStateManager.depthMask(true); GlStateManager.colorMask(false, false, false, false); GlStateManager.disableTexture2D(); GlStateManager.translate(0, 0, 1); RenderUtils.drawCircle(RADIUS, 32); GlStateManager.enableTexture2D(); GlStateManager.depthMask(false); GlStateManager.colorMask(true, true, true, true); GlStateManager.enableDepth(); GlStateManager.depthFunc(GL11.GL_GREATER); GlStateManager.popMatrix(); }
@Override public void drawScreen(final int mouseX, final int mouseY, final float partialTicks) { GlStateManager.disableTexture2D(); // To be on the safe side (see manual.Document#render). GlStateManager.disableAlpha(); GlStateManager.color(1, 1, 1, 1); GlStateManager.clear(GL11.GL_DEPTH_BUFFER_BIT); GlStateManager.enableDepth(); GlStateManager.depthFunc(GL11.GL_LEQUAL); GlStateManager.depthMask(true); GlStateManager.colorMask(false, false, false, false); GlStateManager.pushMatrix(); GlStateManager.translate(0, 0, 500); RenderUtil.drawUntexturedQuad(8, 8, width - 16, height - 16); GlStateManager.popMatrix(); GlStateManager.depthMask(false); GlStateManager.colorMask(true, true, true, true); RenderUtil.drawUntexturedQuad(4, 4, width - 8, height - 8); GlStateManager.enableTexture2D(); }
@Override public void drawForeground(int mouseX, int mouseY) { GlStateManager.clear(GL_DEPTH_BUFFER_BIT); GlStateManager.clearDepth(1f); GlStateManager.depthFunc(GL11.GL_LESS); GlStateManager.enableDepth(); GlStateManager.depthMask(true); GlStateManager.colorMask(false, false, false, false); GlStateManager.disableTexture2D(); RenderUtils.drawPlane(posX, posY, 400, sizeX, sizeY); GlStateManager.enableTexture2D(); GlStateManager.depthMask(false); GlStateManager.colorMask(true, true, true, false); GlStateManager.enableDepth(); GlStateManager.depthFunc(GL11.GL_GREATER); super.drawForeground(mouseX, mouseY); GlStateManager.depthFunc(GL_LEQUAL); GlStateManager.disableDepth(); GlStateManager.depthMask(false); }
private void drawStackWrappers(int mouseX, int mouseY) { if (tile instanceof ITileStackWrapper) { ITileStackWrapper te = (ITileStackWrapper) tile; StackWrapper wrap; for (int i = 0; i < te.getWrapperCount(); i++) { wrap = te.getStackWrapper(i); if (isPointInRegion(wrap.getX() - guiLeft, wrap.getY() - guiTop, Const.SQ - 2, Const.SQ - 2, mouseX, mouseY)) { // this.hoveredSlot = slot; GlStateManager.disableLighting(); GlStateManager.disableDepth(); int j1 = wrap.getX() + 1; int k1 = wrap.getY() + 1; GlStateManager.colorMask(true, true, true, false); this.drawGradientRect(j1, k1, j1 + 16, k1 + 16, stackWrapperColor, stackWrapperColor); GlStateManager.colorMask(true, true, true, true); GlStateManager.enableLighting(); GlStateManager.enableDepth(); if (wrap.isEmpty() == false) this.renderToolTip(wrap.getStack(), mouseX, mouseY); } } } }
GlStateManager.colorMask(false, false, false, false); GlStateManager.depthMask(false); GL11.glStencilFunc(GL11.GL_NEVER, 1, 0xFF); GlStateManager.enableBlend(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.colorMask(true, true, true, true); GlStateManager.depthMask(true); GL11.glStencilMask(0x00);
public void drawStencil(int xStart, int yStart, int xEnd, int yEnd, int flag) { GlStateManager.disableTexture2D(); glStencilFunc(GL_ALWAYS, flag, flag); glStencilOp(GL_ZERO, GL_ZERO, GL_REPLACE); glStencilMask(flag); GlStateManager.colorMask(false, false, false, false); GlStateManager.depthMask(false); glClearStencil(0); GlStateManager.clear(GL_STENCIL_BUFFER_BIT); BufferBuilder vb = Tessellator.getInstance().getBuffer(); vb.begin(GL_QUADS, DefaultVertexFormats.POSITION); vb.pos(xStart, yEnd, 0).endVertex(); vb.pos(xEnd, yEnd, 0).endVertex(); vb.pos(xEnd, yStart, 0).endVertex(); vb.pos(xStart, yStart, 0).endVertex(); Tessellator.getInstance().draw(); GlStateManager.enableTexture2D(); glStencilFunc(GL_EQUAL, flag, flag); glStencilMask(0); GlStateManager.colorMask(true, true, true, false); GlStateManager.depthMask(true); }
public void drawStencil(int xStart, int yStart, int xEnd, int yEnd, int flag) { GlStateManager.disableTexture2D(); GL11.glStencilFunc(GL11.GL_ALWAYS, flag, flag); GL11.glStencilOp(GL11.GL_ZERO, GL11.GL_ZERO, GL11.GL_REPLACE); GL11.glStencilMask(flag); GlStateManager.colorMask(false, false, false, false); GlStateManager.depthMask(false); GL11.glClearStencil(0); GlStateManager.clear(GL11.GL_STENCIL_BUFFER_BIT); BufferBuilder buffer = Tessellator.getInstance().getBuffer(); buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION); buffer.pos(xStart, yEnd, 0).endVertex(); buffer.pos(xEnd, yEnd, 0).endVertex(); buffer.pos(xEnd, yStart, 0).endVertex(); buffer.pos(xStart, yStart, 0).endVertex(); Tessellator.getInstance().draw(); GlStateManager.enableTexture2D(); GL11.glStencilFunc(GL11.GL_EQUAL, flag, flag); GL11.glStencilMask(0); GlStateManager.colorMask(true, true, true, true); GlStateManager.depthMask(true); }