本文整理汇总了Java中org.lwjgl.opengl.GL11.glPopMatrix方法的典型用法代码示例。如果您正苦于以下问题:Java GL11.glPopMatrix方法的具体用法?Java GL11.glPopMatrix怎么用?Java GL11.glPopMatrix使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.opengl.GL11
的用法示例。
在下文中一共展示了GL11.glPopMatrix方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: leaveSafeBlock
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
* Leave a safe block ensuring that all of Slick's OpenGL state is
* restored since the last enter.
*/
public static void leaveSafeBlock()
{
if (!inSafe) {
return;
}
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glPopMatrix();
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glPopMatrix();
GL11.glPopClientAttrib();
GL11.glPopAttrib();
if (lastUsed != null) {
lastUsed.bind();
} else {
TextureImpl.bindNone();
}
inSafe = false;
}
示例2: rotateLocal
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void rotateLocal(float delta, int dim)
{
GL11.glPushMatrix();
GL11.glLoadIdentity();
rotate();
switch(dim)
{
case 0: GL11.glRotated(delta,1,0,0); break;
case 1: GL11.glRotated(delta,0,1,0); break;
case 2: GL11.glRotated(delta,0,0,1); break;
}
GL11.glGetFloat(GL11.GL_MODELVIEW_MATRIX, rotationMatrix);
updateRotationAnglesFromMatrix();
GL11.glPopMatrix();
}
示例3: drawRect
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void drawRect(final float x1, final float y1, final float x2,
final float y2, final int colour) {
final float f = (colour >> 24 & 0xFF) / 255F;
final float f1 = (colour >> 16 & 0xFF) / 255F;
final float f2 = (colour >> 8 & 0xFF) / 255F;
final float f3 = (colour & 0xFF) / 255F;
GL11.glEnable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glEnable(GL11.GL_LINE_SMOOTH);
GL11.glPushMatrix();
GL11.glColor4f(f1, f2, f3, f);
GL11.glBegin(GL11.GL_QUADS);
GL11.glVertex2d(x2, y1);
GL11.glVertex2d(x1, y1);
GL11.glVertex2d(x1, y2);
GL11.glVertex2d(x2, y2);
GL11.glEnd();
GL11.glPopMatrix();
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_LINE_SMOOTH);
}
示例4: render
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
public void render(float alpha)
{
GL11.glPushMatrix();
GL11.glTranslatef(pos.x, pos.y, 0.0F);
GL11.glLineWidth(1.0F);
float color = Main.instance().getFocus() == this ? 0.75F : 1.0F;
GL11.glColor4f(color, color, 1.0F, alpha);
GL11.glBegin(value ? GL11.GL_TRIANGLE_FAN : GL11.GL_LINE_LOOP);
for (float t = 0.0F; t < T_END; t += DT)
{
Vec2 p = Util.squareDir(t).normalize().mult(radius);
GL11.glVertex2f(p.x, p.y);
}
GL11.glEnd();
GL11.glPopMatrix();
}
示例5: drawCircle
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void drawCircle(int xx, int yy, int radius, int col) {
float f = (col >> 24 & 0xFF) / 255.0F;
float f2 = (col >> 16 & 0xFF) / 255.0F;
float f3 = (col >> 8 & 0xFF) / 255.0F;
float f4 = (col & 0xFF) / 255.0F;
GL11.glPushMatrix();
GL11.glEnable(3042);
GL11.glDisable(3553);
GL11.glBlendFunc(770, 771);
GL11.glEnable(2848);
GL11.glShadeModel(7425);
GL11.glBegin(2);
for (int i = 0; i < 70; i++) {
float x = (float) (radius * Math.cos(i * 0.08975979010256552D));
float y = (float) (radius * Math.sin(i * 0.08975979010256552D));
GL11.glColor4f(f2, f3, f4, f);
GL11.glVertex2f(xx + x, yy + y);
}
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glEnd();
GL11.glEnable(3553);
GL11.glDisable(3042);
GL11.glDisable(2848);
GL11.glPopMatrix();
}
示例6: testRayParent
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
* Test to see if a ray insects with the parent part of the bend.
*/
public Double testRayParent()
{
GL11.glPushMatrix();
move();
Double t = testRay(RayTrace.getRayTrace(), getParentBendParts());
GL11.glPopMatrix();
return t;
}
示例7: drawFilledCircle
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void drawFilledCircle(int xx, int yy, float radius, int col) {
float f = (col >> 24 & 0xFF) / 255.0F;
float f2 = (col >> 16 & 0xFF) / 255.0F;
float f3 = (col >> 8 & 0xFF) / 255.0F;
float f4 = (col & 0xFF) / 255.0F;
GL11.glPushMatrix();
GL11.glEnable(3042);
GL11.glDisable(3553);
GL11.glBlendFunc(770, 771);
GL11.glEnable(2848);
GL11.glHint(GL11.GL_PERSPECTIVE_CORRECTION_HINT, GL11.GL_NICEST);
GL11.glBegin(6);
for (int i = 0; i < 50; i++) {
float x = (float) (radius * Math.sin(i * 0.12566370614359174D));
float y = (float) (radius * Math.cos(i * 0.12566370614359174D));
GL11.glColor4f(f2, f3, f4, f);
GL11.glVertex2f(xx + x, yy + y);
}
GL11.glEnd();
GL11.glEnable(3553);
GL11.glDisable(3042);
GL11.glDisable(2848);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glPopMatrix();
}
示例8: drawPlayerESP
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void drawPlayerESP(double d, double d1, double d2, EntityPlayer ep, double e, double f)
{
if(!(ep instanceof EntityPlayerSP))
{
GL11.glPushMatrix();
GL11.glEnable(3042);
if(Wrapper.getFriends().isFriend(ep.getName())) {
GL11.glColor4f(0.0F, 1F, 0.0F, 0.15F);
}else{
GL11.glColor4f(0.7F, 0.0F, 0.0F, 0.15F);
}
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glDepthMask(false);
GL11.glLineWidth(1.0F);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glEnable(GL11.GL_LINE_SMOOTH);
drawBoundingBox(new AxisAlignedBB(d - f, d1 + 0.1, d2 - f, d + f, d1 + e + 0.25, d2 + f));
if(Wrapper.getFriends().isFriend(ep.getName())) {
GL11.glColor4f(0.0F, 1F, 0.0F, 1F);
}else{
GL11.glColor4f(0.7F, 0.0F, 0.0F, 1F);
}
drawOutlinedBoundingBox(new AxisAlignedBB(d - f, d1 + 0.1, d2 - f, d + f, d1 + e + 0.25, d2 + f));
GL11.glDepthMask(true);
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_LINE_SMOOTH);
GL11.glDisable(3042);
GL11.glPopMatrix();
}
}
示例9: renderItem
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
public void renderItem(ItemStack stack, TransformType transformType) {
GL11.glPushMatrix();
GL11.glTranslated(0.5, .5, .5);
GL11.glScalef(0.7F, 0.7F, 0.7F);
GL11.glColor4f(0f, 0f, 0f, 1f);
ResourceLocation rL = new ResourceLocation(Defier.MODID + ":textures/blocks/blank.png");
Minecraft.getMinecraft().getTextureManager().bindTexture(rL);
GL11.glCallList(ClientProxy.defierSphereIdOutside);
GL11.glCallList(ClientProxy.defierSphereIdInside);
GL11.glPopMatrix();
GL11.glColor4f(1f, 1f, 1f, 1f);
}
示例10: drawBorder
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
protected void drawBorder(IProgWidget widget, int color) {
GL11.glPushMatrix();
GL11.glTranslated(widget.getX() + guiLeft, widget.getY() + guiTop, 0);
GL11.glScaled(0.5, 0.5, 1);
drawVerticalLine(0, 0, widget.getHeight(), color);
drawVerticalLine(widget.getWidth(), 0, widget.getHeight(), color);
drawHorizontalLine(widget.getWidth(), 0, 0, color);
drawHorizontalLine(widget.getWidth(), 0, widget.getHeight(), color);
GL11.glPopMatrix();
}
示例11: processRay
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
public void processRay()
{
GL11.glPushMatrix();
super.processRay();
GL11.glPopMatrix();
controller.checkFramePartHighlighting();
}
示例12: doRender
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
public void doRender(EntityBall entity, double x, double y, double z, float yaw, float partialTick) {
GL11.glPushMatrix();
GL11.glTranslatef((float) x, (float) y + entity.height / 2, (float) z);
GL11.glColor4f(0.7F, 0.7F, 0.7F, 1F);
GL11.glRotatef(entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTick - 90.0F,
0.0F, 1.0F, 0.0F);
GL11.glRotatef(entity.prevRotationPitch + (entity.rotationPitch - entity.prevRotationPitch) * partialTick, 0.0F,
0.0F, 1.0F);
bindEntityTexture(entity);
// GL11.glTranslatef((float)entity.posX, (float)entity.posY,
// entity.posZ);
if (entity.getCritical() == 2) {
// GlStateManager.disableTexture2D();
GlStateManager.disableLighting();
// GL11.glColor4f(0.0F, 0.0F, 1.0F, 1F);
model.render(entity, 0F, 0F, 0.0F, 0.0F, 0.0F, 0.0625F);
// GL11.glColor4f(1.0F, 1.0F, 1.0F, 1F);
// GlStateManager.enableTexture2D();
GlStateManager.enableLighting();
} else
model.render(entity, 0F, 0F, 0.0F, 0.0F, 0.0F, 0.0625F);
/*
* GL11.glScalef(1.5f, 1.5f, 1.5f); GL11.glEnable(GL11.GL_BLEND);
* //GL11.glDisable(GL11.GL_ALPHA_TEST); OpenGlHelper.glBlendFunc(770,
* 771, 1, 0);
*
* char c0 = 61680; int j = c0 % 65536; int k = c0 / 65536;
* OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit,
* (float)j / 1.0F, (float)k / 1.0F);
*
* model.render(entity, 0F, 0F, 0.0F, 0.0F, 0.0F, 0.0625F);
* GL11.glDisable(GL11.GL_BLEND); // GL11.glEnable(GL11.GL_ALPHA_TEST);
*/
GL11.glColor4f(1F, 1F, 1F, 1F);
GL11.glPopMatrix();
/*
* IIcon iicon = TF2EventBusListener.pelletIcon;
*
* if (iicon != null) { GL11.glPushMatrix();
* GL11.glTranslatef((float)x,(float) y,(float) z);
* GL11.glEnable(GL12.GL_RESCALE_NORMAL); GL11.glScalef(0.5F, 0.5F,
* 0.5F); this.bindTexture(TextureMap.locationItemsTexture); Tessellator
* tessellator = Tessellator.instance;
*
* float f = iicon.getMinU(); float f1 = iicon.getMaxU(); float f2 =
* iicon.getMinV(); float f3 = iicon.getMaxV(); float f4 = 1.0F; float
* f5 = 0.5F; float f6 = 0.25F; GL11.glRotatef(180.0F -
* this.renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
* GL11.glRotatef(-this.renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
* tessellator.startDrawingQuads(); tessellator.setNormal(0.0F, 1.0F,
* 0.0F); tessellator.addVertexWithUV((double)(0.0F - f5), (double)(0.0F
* - f6), 0.0D, (double)f, (double)f3);
* tessellator.addVertexWithUV((double)(f4 - f5), (double)(0.0F - f6),
* 0.0D, (double)f1, (double)f3);
* tessellator.addVertexWithUV((double)(f4 - f5), (double)(f4 - f6),
* 0.0D, (double)f1, (double)f2);
* tessellator.addVertexWithUV((double)(0.0F - f5), (double)(f4 - f6),
* 0.0D, (double)f, (double)f2); tessellator.draw();
* GL11.glDisable(GL12.GL_RESCALE_NORMAL); GL11.glPopMatrix();
*
* }
*/
}
示例13: renderEntityOnFire
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
private void renderEntityOnFire(Entity entity, double d, double d1, double d2,
float f)
{
GL11.glDisable(2896 /*GL_LIGHTING*/);
int i = Block.fire.blockIndexInTexture;
int j = (i & 0xf) << 4;
int k = i & 0xf0;
float f1 = (float)j / 256F;
float f3 = ((float)j + 15.99F) / 256F;
float f5 = (float)k / 256F;
float f7 = ((float)k + 15.99F) / 256F;
GL11.glPushMatrix();
GL11.glTranslatef((float)d, (float)d1, (float)d2);
float f9 = entity.width * 1.4F;
GL11.glScalef(f9, f9, f9);
loadTexture("/terrain.png");
Tessellator tessellator = Tessellator.instance;
float f10 = 0.5F;
float f11 = 0.0F;
float f12 = entity.height / f9;
float f13 = (float)(entity.posY - entity.boundingBox.minY);
GL11.glRotatef(-renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
GL11.glTranslatef(0.0F, 0.0F, -0.3F + (float)(int)f12 * 0.02F);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
float f14 = 0.0F;
int l = 0;
tessellator.startDrawingQuads();
while(f12 > 0.0F)
{
float f2;
float f4;
float f6;
float f8;
if(l % 2 == 0)
{
f2 = (float)j / 256F;
f4 = ((float)j + 15.99F) / 256F;
f6 = (float)k / 256F;
f8 = ((float)k + 15.99F) / 256F;
} else
{
f2 = (float)j / 256F;
f4 = ((float)j + 15.99F) / 256F;
f6 = (float)(k + 16) / 256F;
f8 = ((float)(k + 16) + 15.99F) / 256F;
}
if((l / 2) % 2 == 0)
{
float f15 = f4;
f4 = f2;
f2 = f15;
}
tessellator.addVertexWithUV(f10 - f11, 0.0F - f13, f14, f4, f8);
tessellator.addVertexWithUV(-f10 - f11, 0.0F - f13, f14, f2, f8);
tessellator.addVertexWithUV(-f10 - f11, 1.4F - f13, f14, f2, f6);
tessellator.addVertexWithUV(f10 - f11, 1.4F - f13, f14, f4, f6);
f12 -= 0.45F;
f13 -= 0.45F;
f10 *= 0.9F;
f14 += 0.03F;
l++;
}
tessellator.draw();
GL11.glPopMatrix();
GL11.glEnable(2896 /*GL_LIGHTING*/);
}
示例14: onRender
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
public void onRender(float partialTicks)
{
// check hitResult
if(mc.objectMouseOver == null)
return;
// check position
BlockPos pos = mc.objectMouseOver.getBlockPos();
if(pos == null)
return;
// check if hitting block
if(!mc.playerController.getIsHittingBlock())
return;
// GL settings
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glEnable(GL11.GL_LINE_SMOOTH);
GL11.glLineWidth(2);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glPushMatrix();
GL11.glTranslated(-mc.getRenderManager().renderPosX,
-mc.getRenderManager().renderPosY,
-mc.getRenderManager().renderPosZ);
// set position
GL11.glTranslated(pos.getX(), pos.getY(), pos.getZ());
// get progress
float progress = mc.playerController.curBlockDamageMP;
// set size
GL11.glTranslated(0.5, 0.5, 0.5);
GL11.glScaled(progress, progress, progress);
GL11.glTranslated(-0.5, -0.5, -0.5);
// get color
float red = progress * 2F;
float green = 2 - red;
// draw box
GL11.glColor4f(red, green, 0, 0.25F);
RenderUtils.drawSolidBox();
GL11.glColor4f(red, green, 0, 0.5F);
RenderUtils.drawOutlinedBox();
GL11.glPopMatrix();
// GL resets
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_LINE_SMOOTH);
}
示例15: render
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
public void render(float alpha)
{
GL11.glPushMatrix();
GL11.glTranslatef(pos.x, pos.y, 0.0f);
GL11.glScalef(radius.x, radius.y, 1.0f);
//Draw outline.
GL11.glLineWidth(1.0f);
float color = Main.instance().getFocus() == this ? 0.75f : 1.0f;
GL11.glColor4f(color, color, 1.0f, alpha);
GL11.glBegin(GL11.GL_LINE_LOOP);
GL11.glVertex2f(-1.0f, -1.0f);
GL11.glVertex2f(-1.0f, 1.0f);
GL11.glVertex2f(1.0f, 1.0f);
GL11.glVertex2f(1.0f, -1.0f);
GL11.glEnd();
//Enable stencil writing, disable color writing.
GL11.glEnable(GL11.GL_STENCIL_TEST);
GL11.glColorMask(false, false, false, false);
GL11.glStencilFunc(GL11.GL_ALWAYS, 1, 0xFF);
GL11.glStencilOp(GL11.GL_KEEP, GL11.GL_KEEP, GL11.GL_REPLACE);
//Draw stencil mask.
GL11.glBegin(GL11.GL_QUADS);
GL11.glVertex2f(-1.0f, -1.0f);
GL11.glVertex2f(-1.0f, 1.0f);
GL11.glVertex2f(1.0f, 1.0f);
GL11.glVertex2f(1.0f, -1.0f);
GL11.glEnd();
//Disable stencil writing, enable color writing.
GL11.glColorMask(true, true, true, true);
GL11.glStencilFunc(GL11.GL_EQUAL, 1, 0xFF);
GL11.glStencilOp(GL11.GL_KEEP, GL11.GL_KEEP, GL11.GL_KEEP);
//Draw masked stuff here.
//Return to normal stencil state.
GL11.glDisable(GL11.GL_STENCIL_TEST);
GL11.glClear(GL11.GL_STENCIL_BUFFER_BIT);
GL11.glPopMatrix();
}