本文整理汇总了Java中org.lwjgl.opengl.GL11.glPushAttrib方法的典型用法代码示例。如果您正苦于以下问题:Java GL11.glPushAttrib方法的具体用法?Java GL11.glPushAttrib怎么用?Java GL11.glPushAttrib使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.opengl.GL11
的用法示例。
在下文中一共展示了GL11.glPushAttrib方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: enterSafeBlock
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
* Enter a safe block ensuring that all the OpenGL state that slick
* uses is safe before touching the GL state directly.
*/
public static void enterSafeBlock()
{
if (inSafe) {
return;
}
Renderer.get().flush();
lastUsed = TextureImpl.getLastBind();
TextureImpl.bindNone();
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
GL11.glPushClientAttrib(GL11.GL_ALL_CLIENT_ATTRIB_BITS);
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glPushMatrix();
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glPushMatrix();
GL11.glMatrixMode(GL11.GL_MODELVIEW);
inSafe = true;
}
示例2: enable
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
* @see org.newdawn.slick.Graphics#enable()
*/
protected void enable() {
if (!valid) {
throw new RuntimeException("Attempt to use a destroy()ed offscreen graphics context.");
}
SlickCallable.enterSafeBlock();
GL11.glPushAttrib(GL11.GL_ALL_ATTRIB_BITS);
GL11.glPushClientAttrib(GL11.GL_ALL_CLIENT_ATTRIB_BITS);
GL11.glMatrixMode(GL11.GL_PROJECTION);
GL11.glPushMatrix();
GL11.glMatrixMode(GL11.GL_MODELVIEW);
GL11.glPushMatrix();
bind();
initGL();
}
示例3: renderOne
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void renderOne(final Entity ent) {
if (!checkValidity((EntityLivingBase)ent)) {
return;
}
GL11.glPushAttrib(1048575);
GL11.glDisable(3008);
GL11.glDisable(3553);
GL11.glDisable(2896);
GL11.glEnable(3042);
GL11.glBlendFunc(770, 771);
GL11.glLineWidth(0.2f);
GL11.glEnable(2848);
GL11.glHint(3154, 4354);
GL11.glEnable(2960);
GL11.glClear(1024);
GL11.glClearStencil(15);
GL11.glStencilFunc(512, 1, 15);
GL11.glStencilOp(7681, 7681, 7681);
colorLines(ent);
GL11.glLineWidth(1.5f);
GL11.glStencilOp(7681, 7681, 7681);
GL11.glPolygonMode(1032, 6913);
}
示例4: 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();
}
示例5: 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();
}
示例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: pushAttrib
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void pushAttrib()
{
GL11.glPushAttrib(8256);
}
示例10: pushAttrib
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void pushAttrib() {
GL11.glPushAttrib(8256);
}
示例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();
}