本文整理汇总了Java中org.lwjgl.opengl.GL11.glPopAttrib方法的典型用法代码示例。如果您正苦于以下问题:Java GL11.glPopAttrib方法的具体用法?Java GL11.glPopAttrib怎么用?Java GL11.glPopAttrib使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.opengl.GL11
的用法示例。
在下文中一共展示了GL11.glPopAttrib方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: drawLine
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void drawLine(double x, double y, double x2, double y2, float red, float green, float blue, float lineWidth) {
int count = FMLClientHandler.instance().getClient().player.ticksExisted;
float alpha = 0.3F + MathHelper.sin((float) (count + x)) * 0.3F + 0.3F;
Tessellator tess = Tessellator.getInstance();
VertexBuffer buff = tess.getBuffer();
GL11.glPushMatrix();
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS | GL11.GL_LIGHTING_BIT);
GL11.glLineWidth(lineWidth);
GL11.glDisable(GL_TEXTURE_2D);
GL11.glBlendFunc(770, 1);
buff.begin(3, DefaultVertexFormats.POSITION_COLOR);
buff.pos(x, y, 0).color(red, green, blue, alpha).endVertex();
buff.pos(x2, y2, 0).color(red, green, blue, alpha).endVertex();
tess.draw();
GL11.glBlendFunc(770, 771);
GL11.glDisable(32826);
GL11.glEnable(GL_TEXTURE_2D);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glPopAttrib();
GL11.glPopMatrix();
}
示例3: render
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
private void render(EntityPlayerSP player, float partialTicks) {
double x = player.lastTickPosX + (player.posX - player.lastTickPosX) * partialTicks;
double y = player.lastTickPosY + (player.posY - player.lastTickPosY) * partialTicks;
double z = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * partialTicks;
TextureManager tm = Minecraft.getMinecraft().renderEngine;
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
GL11.glPushMatrix();
GL11.glColor4f(1.0f, 1.0f, 1.0f, 0.3f);
GL11.glEnable(GL11.GL_BLEND);
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
if (areaOverlays != null) {
for (PowerOverlayData overlay : areaOverlays) {
drawIconVectors(x, y, z, tm, overlay);
}
}
drawIconVectors(x, y, z, tm, cursorOverlay);
GL11.glPopMatrix();
GL11.glPopAttrib();
}
示例4: disable
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
* @see org.newdawn.slick.Graphics#disable()
*/
protected void disable() {
GL.flush();
unbind();
GL11.glPopClientAttrib();
GL11.glPopAttrib();
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glPopMatrix();
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glPopMatrix();
GL11.glMatrixMode(GL11.GL_MODELVIEW);
SlickCallable.leaveSafeBlock();
}
示例5: renderFive
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void renderFive(final Entity ent) {
if (!checkValidity((EntityLivingBase)ent)) {
return;
}
GL11.glPolygonOffset(1.0f, 2000000.0f);
GL11.glDisable(10754);
GL11.glDisable(2960);
GL11.glDisable(2848);
GL11.glHint(3154, 4352);
GL11.glDisable(3042);
GL11.glEnable(2896);
GL11.glEnable(3553);
GL11.glEnable(3008);
GL11.glPopAttrib();
}
示例6: onDraw
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@SubscribeEvent
public void onDraw(RenderWorldLastEvent event){
float partialTicks = event.getPartialTicks();
double pX = MINECRAFT.player.prevPosX + (MINECRAFT.player.posX - MINECRAFT.player.prevPosX) * partialTicks;
double pY = MINECRAFT.player.prevPosY + (MINECRAFT.player.posY - MINECRAFT.player.prevPosY) * partialTicks;
double pZ = MINECRAFT.player.prevPosZ + (MINECRAFT.player.posZ - MINECRAFT.player.prevPosZ) * partialTicks;
/* Prepare */
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
GL11.glPushMatrix();
GL11.glTranslated(-pX,-pY,-pZ);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glHint( GL11.GL_LINE_SMOOTH_HINT, GL11.GL_NICEST );
calculateFlash();
drawBlocksAndChunks(pY);
drawEntities(partialTicks);
drawTileEntityTags();
drawEntityTags(partialTicks);
/* Restore settings */
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glPopMatrix();
GL11.glPopAttrib();
}
示例7: onRenderHand
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Inject(method = "renderHand(FI)V", at = @At("HEAD"), cancellable = true)
public void onRenderHand(float partialTicks, int xOffset, CallbackInfo callbackInfo) {
if (isShadowPass != null) {
try {
isShadowPass.setBoolean(null, false);
} catch (IllegalAccessException ignored) {
}
}
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
GL11.glPushMatrix();
EventManager.post(new RenderWorld(partialTicks));
GL11.glColor4d(1, 1, 1, 1);
if (mc.gameSettings.viewBobbing) {
mc.gameSettings.viewBobbing = false;
GL11.glPushMatrix();
setupCameraTransform(partialTicks, 2);
EventManager.post(new RenderWorldBobbing(partialTicks));
setupCameraTransform(partialTicks, 2);
GL11.glPopMatrix();
mc.gameSettings.viewBobbing = true;
} else {
EventManager.post(new RenderWorldBobbing(partialTicks));
}
GL11.glColor4d(1, 1, 1, 1);
GL11.glPopMatrix();
GL11.glPopAttrib();
if (EventManager.post(new RenderHand()).isCancelled()) {
callbackInfo.cancel();
}
}
示例8: draw
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void draw(int x, int y) {
GL11.glPushMatrix();
GL11.glPushAttrib(8256);
int toAdd = 0;
if(dragging) {
drag(x, y);
}
RenderUtils.drawBorderedRect(getXAndDrag(), getYAndDrag(), getXAndDrag() + 100, getYAndDrag() + 13 + (isOpen ? (12 * buttonList.size() + 0.5F) + (19 * sliderList.size() + (sliderList.size() != 0 ? 2.5F : 0)) : 0) + toAdd, 0.5F, 0xFF000000, 0x80000000);
Fonts.roboto18.drawStringWithShadow(title, getXAndDrag() + 3, getYAndDrag() + 1, 0xFFFFFF);
if(Wrapper.getMinecraft().currentScreen instanceof XdolfGuiClick) {
RenderUtils.drawBorderedRect(getXAndDrag() + 79, getYAndDrag() + 2, getXAndDrag() + 88, getYAndDrag() + 11, 0.5F, 0xFF000000, isPinned ? 0xFFFF0000 : 0xFF383b42);
RenderUtils.drawBorderedRect(getXAndDrag() + 89, getYAndDrag() + 2, getXAndDrag() + 98, getYAndDrag() + 11, 0.5F, 0xFF000000, isOpen ? 0xFFFF0000 : 0xFF383b42);
}
if(isOpen) {
for(XdolfButton b : buttonList) {
b.draw();
if(x >= b.getX() + dragX && y >= b.getY() + dragY && x <= b.getX() + 96 + dragX && y <= b.getY() + 11 + dragY) {
b.overButton = true;
} else {
b.overButton = false;
}
}
for(XdolfSlider s : sliderList) {
s.draw(x);
}
}
//GL11.glEnable(GL11.GL_BLEND);
GL11.glPopMatrix();
GL11.glPopAttrib();
}
示例9: popAttrib
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void popAttrib()
{
GL11.glPopAttrib();
}
示例10: popAttrib
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void popAttrib() {
GL11.glPopAttrib();
}
示例11: draw
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
public void draw(int x, int y) {
GL11.glPushMatrix();
GL11.glPushAttrib(8256);
if (dragging) {
drag(x, y);
}
if (isOpen()) {
RenderUtils.drawBetterBorderedRect(getXAndDrag(), getYAndDrag(), getXAndDrag() + 100, getYAndDrag() + 66,
0.5F, 0xFF000000, 0x80000000);
if (Wrapper.getPlayer().dimension == -1) {
Fonts.roboto18.drawStringWithShadow(Wrapper.getMinecraft().getDebugFPS() + " FPS", getXAndDrag() + 3, getYAndDrag() + 13, 0xFFFFFF);
Fonts.roboto18.drawStringWithShadow("X: " + (int)Wrapper.getPlayer().posX + " (" + (int)Wrapper.getPlayer().posX * 8 + ")", getXAndDrag() + 3, getYAndDrag() + 23, 0xFFFFFF);
Fonts.roboto18.drawStringWithShadow("Y: " + (int)Wrapper.getPlayer().posY + " (" + (int)Wrapper.getPlayer().posY * 8 + ")", getXAndDrag() + 3, getYAndDrag() + 33, 0xFFFFFF);
Fonts.roboto18.drawStringWithShadow("Z: " + (int)Wrapper.getPlayer().posZ + " (" + (int)Wrapper.getPlayer().posZ * 8 + ")", getXAndDrag() + 3, getYAndDrag() + 43, 0xFFFFFF);
} else {
Fonts.roboto18.drawStringWithShadow(Wrapper.getMinecraft().getDebugFPS() + " FPS", getXAndDrag() + 3,
getYAndDrag() + 13, 0xFFFFFF);
Fonts.roboto18.drawStringWithShadow("X: " + (int) Wrapper.getPlayer().posX, getXAndDrag() + 3,
getYAndDrag() + 23, 0xFFFFFF);
Fonts.roboto18.drawStringWithShadow("Y: " + (int) Wrapper.getPlayer().posY, getXAndDrag() + 3,
getYAndDrag() + 33, 0xFFFFFF);
Fonts.roboto18.drawStringWithShadow("Z: " + (int) Wrapper.getPlayer().posZ, getXAndDrag() + 3,
getYAndDrag() + 43, 0xFFFFFF);
}
Fonts.roboto18.drawStringWithShadow(Wrapper.getMinecraft().session.username, getXAndDrag() + 3,
getYAndDrag() + 53, 0xFFFFFF);
Fonts.roboto18.drawStringWithShadow(getTitle(), getXAndDrag() + 3, getYAndDrag() + 1, 0xFFFFFFFF);
if (Wrapper.getMinecraft().currentScreen instanceof XdolfGuiClick) {
RenderUtils.drawBetterBorderedRect(getXAndDrag() + 79, getYAndDrag() + 2, getXAndDrag() + 88,
getYAndDrag() + 11, 0.5F, 0xFF000000, isPinned() ? 0xFFFF0000 : 0xFF383b42);
RenderUtils.drawBetterBorderedRect(getXAndDrag() + 89, getYAndDrag() + 2, getXAndDrag() + 98,
getYAndDrag() + 11, 0.5F, 0xFF000000, isOpen() ? 0xFFFF0000 : 0xFF383b42);
}
} else {
RenderUtils.drawBetterBorderedRect(getXAndDrag(), getYAndDrag(), getXAndDrag() + 100, getYAndDrag() + 14,
0.5F, 0xFF000000, 0x80000000);
Fonts.roboto18.drawStringWithShadow(getTitle(), getXAndDrag() + 3, getYAndDrag() + 1, 0xFFFFFFFF);
if (Wrapper.getMinecraft().currentScreen instanceof XdolfGuiClick) {
RenderUtils.drawBetterBorderedRect(getXAndDrag() + 79, getYAndDrag() + 2, getXAndDrag() + 88,
getYAndDrag() + 11, 0.5F, 0xFF000000, isPinned() ? 0xFFFF0000 : 0xFF383b42);
RenderUtils.drawBetterBorderedRect(getXAndDrag() + 89, getYAndDrag() + 2, getXAndDrag() + 98,
getYAndDrag() + 11, 0.5F, 0xFF000000, isOpen() ? 0xFFFF0000 : 0xFF383b42);
}
}
GL11.glPopMatrix();
GL11.glPopAttrib();
}