本文整理汇总了Java中org.lwjgl.opengl.GL11.glVertex2i方法的典型用法代码示例。如果您正苦于以下问题:Java GL11.glVertex2i方法的具体用法?Java GL11.glVertex2i怎么用?Java GL11.glVertex2i使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.opengl.GL11
的用法示例。
在下文中一共展示了GL11.glVertex2i方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderTitleBarButton
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
private void renderTitleBarButton(int x1, int y1, int x2, int y2,
boolean hovering)
{
int x3 = x2 + 2;
// button background
GL11.glColor4f(bgColor[0], bgColor[1], bgColor[2],
hovering ? 0.75F : 0.5F);
GL11.glBegin(GL11.GL_QUADS);
GL11.glVertex2i(x1, y1);
GL11.glVertex2i(x1, y2);
GL11.glVertex2i(x2, y2);
GL11.glVertex2i(x2, y1);
GL11.glEnd();
// background between buttons
GL11.glColor4f(acColor[0], acColor[1], acColor[2], 0.5F);
GL11.glBegin(GL11.GL_QUADS);
GL11.glVertex2i(x2, y1);
GL11.glVertex2i(x2, y2);
GL11.glVertex2i(x3, y2);
GL11.glVertex2i(x3, y1);
GL11.glEnd();
// button outline
GL11.glBegin(GL11.GL_LINE_LOOP);
GL11.glVertex2i(x1, y1);
GL11.glVertex2i(x1, y2);
GL11.glVertex2i(x2, y2);
GL11.glVertex2i(x2, y1);
GL11.glEnd();
}
示例2: drawQuads
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
private void drawQuads(int x1, int y1, int x2, int y2)
{
GL11.glBegin(GL11.GL_QUADS);
GL11.glVertex2i(x1, y1);
GL11.glVertex2i(x2, y1);
GL11.glVertex2i(x2, y2);
GL11.glVertex2i(x1, y2);
GL11.glEnd();
}
示例3: render
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
public void render(int mouseX, int mouseY)
{
ClickGui gui = WurstClient.INSTANCE.getGui();
float[] bgColor = gui.getBgColor();
float[] acColor = gui.getAcColor();
int x1 = getX();
int x2 = x1 + getWidth();
int y1 = getY();
int y2 = y1 + getHeight();
boolean hovering =
mouseX >= x1 && mouseY >= y1 && mouseX < x2 && mouseY < y2;
if(hovering)
gui.setTooltip(null);
// outline
GL11.glColor4f(acColor[0], acColor[1], acColor[2], 0.5F);
GL11.glBegin(GL11.GL_LINE_LOOP);
GL11.glVertex2i(x1, y1);
GL11.glVertex2i(x1, y2);
GL11.glVertex2i(x2, y2);
GL11.glVertex2i(x2, y1);
GL11.glEnd();
String[] values = ((ComboBox)getOwner()).setting.getModes();
int yi1 = y1 - 11;
for(String value : values)
{
if(value.equalsIgnoreCase(
((ComboBox)getOwner()).setting.getSelectedMode()))
continue;
yi1 += 11;
int yi2 = yi1 + 11;
boolean hValue = hovering && mouseY >= yi1 && mouseY < yi2;
// background
GL11.glColor4f(bgColor[0], bgColor[1], bgColor[2],
hValue ? 0.75F : 0.5F);
GL11.glBegin(GL11.GL_QUADS);
GL11.glVertex2i(x1, yi1);
GL11.glVertex2i(x1, yi2);
GL11.glVertex2i(x2, yi2);
GL11.glVertex2i(x2, yi1);
GL11.glEnd();
// value name
GL11.glColor4f(1, 1, 1, 1);
GL11.glEnable(GL11.GL_TEXTURE_2D);
FontRenderer fr = Fonts.segoe18;
fr.drawString(value.toString(), x1 + 2, yi1 - 1, 0xf0f0f0);
GL11.glDisable(GL11.GL_TEXTURE_2D);
}
}
示例4: drawBox
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
private void drawBox(int x1, int y1, int x2, int y2)
{
// color
GL11.glColor4f(0.25F, 0.25F, 0.25F, 0.5F);
float[] acColor = WurstClient.INSTANCE.getGui().getAcColor();
boolean rainbow = WurstClient.INSTANCE.mods.rainbowUiMod.isActive();
// box
GL11.glBegin(GL11.GL_QUADS);
{
GL11.glVertex2i(x1, y1);
GL11.glVertex2i(x2, y1);
GL11.glVertex2i(x2, y2);
GL11.glVertex2i(x1, y2);
}
GL11.glEnd();
// outline positions
double xi1 = x1 - 0.1;
double xi2 = x2 + 0.1;
double yi1 = y1 - 0.1;
double yi2 = y2 + 0.1;
// outline
GL11.glLineWidth(1);
if(rainbow)
GL11.glColor4f(acColor[0], acColor[1], acColor[2], 0.5F);
else
GL11.glColor4f(0, 0, 0, 0.5F);
GL11.glBegin(GL11.GL_LINE_LOOP);
{
GL11.glVertex2d(xi1, yi1);
GL11.glVertex2d(xi2, yi1);
GL11.glVertex2d(xi2, yi2);
GL11.glVertex2d(xi1, yi2);
}
GL11.glEnd();
// shadow positions
xi1 -= 0.9;
xi2 += 0.9;
yi1 -= 0.9;
yi2 += 0.9;
float[] shadow;
if(rainbow)
shadow = acColor;
else
shadow = new float[]{0.125F, 0.125F, 0.125F};
// top left
GL11.glBegin(GL11.GL_POLYGON);
{
GL11.glColor4f(shadow[0], shadow[1], shadow[2], 0.75F);
GL11.glVertex2d(x1, y1);
GL11.glVertex2d(x2, y1);
GL11.glColor4f(0, 0, 0, 0);
GL11.glVertex2d(xi2, yi1);
GL11.glVertex2d(xi1, yi1);
GL11.glVertex2d(xi1, yi2);
GL11.glColor4f(shadow[0], shadow[1], shadow[2], 0.75F);
GL11.glVertex2d(x1, y2);
}
GL11.glEnd();
// bottom right
GL11.glBegin(GL11.GL_POLYGON);
{
GL11.glVertex2d(x2, y2);
GL11.glVertex2d(x2, y1);
GL11.glColor4f(0, 0, 0, 0);
GL11.glVertex2d(xi2, yi1);
GL11.glVertex2d(xi2, yi2);
GL11.glVertex2d(xi1, yi2);
GL11.glColor4f(shadow[0], shadow[1], shadow[2], 0.75F);
GL11.glVertex2d(x1, y2);
}
GL11.glEnd();
}