本文整理汇总了Java中org.lwjgl.opengl.GL11.glGetBoolean方法的典型用法代码示例。如果您正苦于以下问题:Java GL11.glGetBoolean方法的具体用法?Java GL11.glGetBoolean怎么用?Java GL11.glGetBoolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.opengl.GL11
的用法示例。
在下文中一共展示了GL11.glGetBoolean方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderUI
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void renderUI(float partialTicks)
{
if(!WurstClient.INSTANCE.isEnabled())
return;
boolean blend = GL11.glGetBoolean(GL11.GL_BLEND);
ClickGui clickGui = WurstClient.INSTANCE.getGui();
// GL settings
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glDisable(GL11.GL_TEXTURE_2D);
clickGui.updateColors();
wurstLogo.render();
modList.render(partialTicks);
tabGui.render(partialTicks);
// pinned windows
if(!(Minecraft.getMinecraft().currentScreen instanceof ClickGuiScreen))
clickGui.renderPinnedWindows();
WurstClient.INSTANCE.events.fire(GUIRenderEvent.INSTANCE);
// GL resets
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glColor4f(1, 1, 1, 1);
if(blend)
GL11.glEnable(GL11.GL_BLEND);
else
GL11.glDisable(GL11.GL_BLEND);
}
示例2: drawScreen
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
public void drawScreen(int mouseX, int mouseY, float partialTicks) {
boolean blend = GL11.glGetBoolean(GL11.GL_BLEND);
guiManager.drawScreen(mouseX, mouseY, partialTicks);
if (blend) {
GL11.glEnable(GL11.GL_BLEND);
} else {
GL11.glDisable(GL11.GL_BLEND);
}
}
示例3: drawModsRender
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
Called on world draw
note: used to be drawModsRender()
*/
static void worldDraw(float delta) {
if (!initialized) return;
if (getView() == null || getWorld() == null
|| getRenderer() == null) return;
try {
// update time
//curTick = System.nanoTime();
//seconds = ((float)(curTick - prevTick)) * 0.000000001f;
//if (seconds > 1f) seconds = 0f;
//prevTick = curTick;
// keyboard state update
Keys.newFrame();
// update player position
Entity view = getView();
Vec3d pos = getPositionDelta(view, delta);
float x = (float) getX(pos), y = (float) getY(pos), z = (float) getZ(pos);
// draw in 3d
boolean gltex2d = GL11.glGetBoolean(GL11.GL_TEXTURE_2D);
boolean gldepth = GL11.glGetBoolean(GL11.GL_DEPTH_TEST);
boolean glblend = GL11.glGetBoolean(GL11.GL_BLEND);
boolean glfog = GL11.glGetBoolean(GL11.GL_FOG);
// notify mods
for (ZMod mod : zombesMods)
try {
mod.notifyWorldDraw(delta, x,y,z);
} catch (Exception e) {
err("in mod \""+mod.getName()+"\": world draw failed", e);
}
// cleaning
if (glfog) GL11.glEnable( GL11.GL_FOG);
else GL11.glDisable(GL11.GL_FOG);
if (glblend) GL11.glEnable( GL11.GL_BLEND);
else GL11.glDisable(GL11.GL_BLEND);
if (gldepth) GL11.glEnable( GL11.GL_DEPTH_TEST);
else GL11.glDisable(GL11.GL_DEPTH_TEST);
if (gltex2d) GL11.glEnable( GL11.GL_TEXTURE_2D);
else GL11.glDisable(GL11.GL_TEXTURE_2D);
} catch(Exception error) { err("error: draw-handle failed", error); }
}
示例4: renderTooltip
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void renderTooltip(int x, int y, List<String> tooltipData, Color color, Color colorFade, Color strColor, FontRenderer fontRenderer) {
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
boolean lighting = GL11.glGetBoolean(GL11.GL_LIGHTING);
if (lighting)
RenderHelper.disableStandardItemLighting();
if (!tooltipData.isEmpty()) {
int esWidth = 0;
for (String toolTip : tooltipData) {
int width = fontRenderer.getStringWidth(toolTip);
if (width > esWidth)
esWidth = width;
}
ScaledResolution sr = new ScaledResolution(Minecraft.getMinecraft());
if(x + 15 + esWidth > sr.getScaledWidth()) {
x -= esWidth + 24;
}
int sumLineHeight = 8;
if (tooltipData.size() > 1)
sumLineHeight += 2 + (tooltipData.size() - 1) * 10;
if(y + sumLineHeight > sr.getScaledHeight()) {
y = (sr.getScaledHeight() - sumLineHeight);
y = Math.max(25, y);
}
int pX = x + 12;
int pY = y - 12;
float z = 300F;
drawGradientRect(pX - 3, pY - 4, z, pX + esWidth + 3, pY - 3, color, colorFade);
drawGradientRect(pX - 3, pY + sumLineHeight + 3, z, pX + esWidth + 3, pY + sumLineHeight + 4, color, colorFade);
drawGradientRect(pX - 3, pY - 3, z, pX + esWidth + 3, pY + sumLineHeight + 3, color, colorFade);
drawGradientRect(pX - 4, pY - 3, z, pX - 3, pY + sumLineHeight + 3, color, colorFade);
drawGradientRect(pX + esWidth + 3, pY - 3, z, pX + esWidth + 4, pY + sumLineHeight + 3, color, colorFade);
int rgb = color.getRGB();
int col = (rgb & 0x00FFFFFF) | rgb & 0xFF000000;
Color colOp = new Color(col);
drawGradientRect(pX - 3, pY - 3 + 1, z, pX - 3 + 1, pY + sumLineHeight + 3 - 1, color, colOp);
drawGradientRect(pX + esWidth + 2, pY - 3 + 1, z, pX + esWidth + 3, pY + sumLineHeight + 3 - 1, color, colOp);
drawGradientRect(pX - 3, pY - 3, z, pX + esWidth + 3, pY - 3 + 1, colOp, colOp);
drawGradientRect(pX - 3, pY + sumLineHeight + 2, z, pX + esWidth + 3, pY + sumLineHeight + 3, color, color);
GlStateManager.disableDepth();
for (int i = 0; i < tooltipData.size(); ++i) {
String str = tooltipData.get(i);
fontRenderer.drawString(str, pX, pY, strColor.getRGB());
if (i == 0)
pY += 2;
pY += 10;
}
GlStateManager.color(1F, 1F, 1F, 1F);
GlStateManager.enableDepth();
}
if (lighting)
RenderHelper.enableStandardItemLighting();
GlStateManager.color(1F, 1F, 1F, 1F);
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
}