本文整理汇总了Java中org.lwjgl.opengl.GL11.glStencilOp方法的典型用法代码示例。如果您正苦于以下问题:Java GL11.glStencilOp方法的具体用法?Java GL11.glStencilOp怎么用?Java GL11.glStencilOp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.opengl.GL11
的用法示例。
在下文中一共展示了GL11.glStencilOp方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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);
}
示例2: renderTwo
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void renderTwo(final Entity ent) {
if (!checkValidity((EntityLivingBase)ent)) {
return;
}
GL11.glStencilFunc(512, 0, 15);
GL11.glStencilOp(7681, 7681, 7681);
GL11.glPolygonMode(1032, 6914);
}
示例3: renderThree
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void renderThree(final Entity ent) {
if (!checkValidity((EntityLivingBase)ent)) {
return;
}
GL11.glStencilFunc(514, 1, 15);
GL11.glStencilOp(7680, 7680, 7680);
GL11.glPolygonMode(1032, 6913);
}
示例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.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.
camera.multYMatrix();
AAB2 bounds = camera.getBounds();
int bottom = Math.max(Util.floor(bounds.y0), 0);
int top = Math.min(Util.ceil(bounds.y1), keys.length);
GL11.glLineWidth(1.0f);
Key focus = null;
for (int i=bottom; i<top; i++)
{
Key key = keys[i];
if (key == Main.instance().getFocus()) focus = key;
else key.render(alpha);
}
if (focus != null) focus.render(alpha);
//Return to normal stencil state.
GL11.glDisable(GL11.GL_STENCIL_TEST);
GL11.glClear(GL11.GL_STENCIL_BUFFER_BIT);
GL11.glPopMatrix();
}
示例5: 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();
}
示例6: render
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
public void render(float alpha)
{
setScrollPos(scrollPos);
float x0 = pos.x - radius.x, x1 = pos.x + radius.x;
float y0 = pos.y - radius.y, y1 = pos.y + radius.y;
GL11.glLineWidth(1.0f);
GL11.glColor4f(1.0f, 1.0f, 1.0f, alpha);
GL11.glBegin(GL11.GL_LINE_LOOP);
GL11.glVertex2f(x0, y0);
GL11.glVertex2f(x0, y1);
GL11.glVertex2f(x1, y1);
GL11.glVertex2f(x1, y0);
GL11.glEnd();
float barX = x1 - BAR_WIDTH;
GL11.glColor4f(1.0f, 1.0f, 1.0f, alpha*0.25f);
GL11.glBegin(GL11.GL_LINES);
GL11.glVertex2f(barX, y0);
GL11.glVertex2f(barX, y1);
GL11.glEnd();
upButton.render(alpha);
downButton.render(alpha);
thumb.render(alpha);
if (content != null)
{
//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(x0, y0);
GL11.glVertex2f(x0, y1);
GL11.glVertex2f(barX, y1);
GL11.glVertex2f(barX, y0);
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);
GL11.glPushMatrix();
GL11.glTranslatef(0.0f, scrollPos, 0.0f);
content.render(alpha);
GL11.glPopMatrix();
//Disable stencil.
GL11.glDisable(GL11.GL_STENCIL_TEST);
//Clear stencil buffer.
GL11.glClear(GL11.GL_STENCIL_BUFFER_BIT);
}
}
示例7: render
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
public void render(float alpha)
{
float x0 = pos.x - radius.x, x1 = pos.x + radius.x;
float y0 = pos.y - radius.y, y1 = pos.y + radius.y;
GL11.glLineWidth(1.0f);
GL11.glColor4f(1.0f, 1.0f, 1.0f, alpha);
GL11.glBegin(GL11.GL_LINE_LOOP);
GL11.glVertex2f(x0, y0);
GL11.glVertex2f(x0, y1);
GL11.glVertex2f(x1, y1);
GL11.glVertex2f(x1, y0);
GL11.glEnd();
if (label != null)
{
//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(x0, y0);
GL11.glVertex2f(x0, y1);
GL11.glVertex2f(x1, y1);
GL11.glVertex2f(x1, y0);
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);
label.render(alpha);
//Disable stencil.
GL11.glDisable(GL11.GL_STENCIL_TEST);
//Clear stencil buffer.
GL11.glClear(GL11.GL_STENCIL_BUFFER_BIT);
}
}