List of usage examples for org.lwjgl.opengl GL11 glDepthMask
public static void glDepthMask(@NativeType("GLboolean") boolean flag)
From source file:cn.academy.energy.client.render.tile.RenderMatrix.java
License:Open Source License
@Override public void renderAtOrigin(TileEntity te) { TileMatrix tm = (TileMatrix) te;/*from ww w . ja v a 2s. c om*/ GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glPushMatrix(); { GL11.glTranslated(-1, 0, -1); double scale = 0.22; GL11.glScaled(scale, scale, scale); RenderUtils.loadTexture(tex); GL11.glDepthMask(true); model.renderPart("base"); GL11.glPushMatrix(); { GL11.glTranslated(0, 6.3, 0); drawCube(tm.isLoaded); } GL11.glPopMatrix(); GL11.glDepthMask(false); RenderUtils.loadTexture(tex); model.renderPart("plate"); } GL11.glPopMatrix(); }
From source file:cn.academy.vanilla.electromaster.client.effect.SubArcHandler.java
License:GNU General Public License
public void drawAll() { Iterator<SubArc> iter = list.iterator(); GL11.glDepthMask(false); while (iter.hasNext()) { SubArc arc = iter.next();/*from ww w . jav a2 s. c o m*/ if (!arc.dead && arc.draw) { GL11.glPushMatrix(); RenderUtils.glTranslate(arc.pos); GL11.glRotated(arc.rotZ, 0, 0, 1); GL11.glRotated(arc.rotY, 0, 1, 0); GL11.glRotated(arc.rotX, 1, 0, 0); final double scale = 0.3; GL11.glScaled(scale, scale, scale); GL11.glTranslated(-arcs[arc.texID].length / 2, 0, 0); arcs[arc.texID].draw(); GL11.glPopMatrix(); } } GL11.glDepthMask(true); }
From source file:cn.academy.vanilla.electromaster.client.effect.SubArcHandler2D.java
License:GNU General Public License
public void drawAll() { Iterator<SubArc2D> iter = list.iterator(); GL11.glDepthMask(false); GL11.glPushMatrix();//from ww w. jav a 2 s. c om while (iter.hasNext()) { SubArc2D arc = iter.next(); if (!arc.dead && arc.draw) { GL11.glPushMatrix(); GL11.glTranslated(xScale * arc.x - arc.size / 2, yScale * arc.y - arc.size / 2, 0); RenderUtils.loadTexture(arcs[arc.texID]); HudUtils.rect(0, 0, arc.size, arc.size); GL11.glPopMatrix(); } } GL11.glPopMatrix(); GL11.glDepthMask(true); }
From source file:cn.academy.vanilla.generic.client.render.RippleMarkRender.java
License:GNU General Public License
@Override public void doRender(Entity entity, double x, double y, double z, float a, float b) { EntityRippleMark mark = (EntityRippleMark) entity; long dt = GameTimer.getTime() - mark.creationTime; GL11.glDisable(GL11.GL_CULL_FACE);//from w ww .jav a 2 s . co m GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glAlphaFunc(GL11.GL_GREATER, 0); GL11.glDepthMask(false); GL11.glPushMatrix(); GL11.glTranslated(x, y, z); for (int i = 0; i < timeOffsets.length; ++i) { GL11.glPushMatrix(); long mod = (dt - timeOffsets[i]) % CYCLE; float size = getSize(mod); GL11.glTranslatef(0, getHeight(mod), 0); GL11.glScalef(size, 1, size); material.color = mark.color.copy(); material.color.a *= getAlpha(mod); mesh.draw(material); GL11.glPopMatrix(); } GL11.glPopMatrix(); GL11.glDepthMask(true); GL11.glAlphaFunc(GL11.GL_GEQUAL, 0.1f); GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glEnable(GL11.GL_DEPTH_TEST); }
From source file:cn.lambdalib.util.client.auxgui.AuxGuiHandler.java
License:MIT License
@SubscribeEvent public void drawHudEvent(RenderGameOverlayEvent event) { GL11.glDepthFunc(GL11.GL_ALWAYS);//from w w w. j ava 2s . c o m GL11.glDepthMask(false); GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); RenderUtils.pushTextureState(); if (event.type == ElementType.EXPERIENCE) { Iterator<AuxGui> iter = auxGuiList.iterator(); startIterating(); while (iter.hasNext()) { AuxGui gui = iter.next(); if (!gui.isDisposed()) { if (!gui.lastFrameActive) gui.lastActivateTime = GameTimer.getTime(); gui.draw(event.resolution); gui.lastFrameActive = true; } } endIterating(); } RenderUtils.popTextureState(); GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glDepthMask(true); GL11.glDepthFunc(GL11.GL_LEQUAL); }
From source file:cn.liutils.api.gui.LIGui.java
License:Open Source License
/** * Go down the hierarchy tree and draw each widget node. */// ww w . ja va 2 s. c o m public void draw(double mx, double my) { frameUpdate(); updateMouse(mx, my); iterating = true; GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glDepthFunc(GL11.GL_ALWAYS); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glDepthMask(false); drawTraverse(mx, my, null, this, getTopNode(mx, my)); GL11.glDepthFunc(GL11.GL_LEQUAL); GL11.glEnable(GL11.GL_ALPHA_TEST); iterating = false; }
From source file:cn.liutils.core.event.LIClientEvents.java
License:Open Source License
@SubscribeEvent public void drawHudEvent(RenderGameOverlayEvent event) { GL11.glDepthFunc(GL11.GL_ALWAYS);//from w w w. j a va2 s.co m GL11.glDepthMask(false); GL11.glDisable(GL11.GL_ALPHA_TEST); if (event.type == ElementType.CROSSHAIRS) { for (AuxGui gui : auxGuiList) { if (gui.isOpen()) gui.draw(event.resolution); } } GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glDepthMask(true); GL11.glDepthFunc(GL11.GL_LEQUAL); }
From source file:com.a2client.corex.Render.java
License:Open Source License
static public void setDepthWrite(boolean v) { if (depth_write != v) { depth_write = v; GL11.glDepthMask(v); } }
From source file:com.ardor3d.scene.state.lwjgl.LwjglZBufferStateUtil.java
License:Open Source License
private static void enableWrite(final boolean enable, final ZBufferStateRecord record) { if (enable != record.writable || !record.isValid()) { GL11.glDepthMask(enable); record.writable = enable;//from ww w .j a v a2s .co m } }
From source file:com.badlogic.gdx.backends.jglfw.JglfwGL20.java
License:Apache License
public void glDepthMask(boolean flag) { GL11.glDepthMask(flag); }