本文整理汇总了Java中org.lwjgl.opengl.GL11.glClear方法的典型用法代码示例。如果您正苦于以下问题:Java GL11.glClear方法的具体用法?Java GL11.glClear怎么用?Java GL11.glClear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.opengl.GL11
的用法示例。
在下文中一共展示了GL11.glClear方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: start
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
* Start the test
*/
public void start() {
initGL(800,600);
init();
while (true) {
update();
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
render();
Display.update();
Display.sync(100);
if (Display.isCloseRequested()) {
System.exit(0);
}
}
}
示例2: 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);
}
示例3: render
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/** Render everything based on the tiem since the last frame
*
* @param delta time between the last frame
*/
private void render(long delta){
//if rendering is disabled, just don't render
if(!Window.canRender())
return;
//clear the color
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
//render the frame
scene.render(delta);
_interface.render(delta);
//show new frame
window.swapBuffers();
}
示例4: clear
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void clear(int mask)
{
if (clearEnabled)
{
GL11.glClear(mask);
}
}
示例5: render3D
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public void render3D(float partialTicks) {
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glDepthMask(false);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_BLEND);
GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
Minecraft.getMinecraft().getRenderManager().renderEngine.bindTexture(Textures.GLOW_RESOURCE);
// mc.func_110434_K().func_110577_a(Textures.GLOW_RESOURCE);
for (Map.Entry<EntityItem, Integer> entry : searchedItems.entrySet()) {
EntityItem item = entry.getKey();
float height = MathHelper.sin((item.getAge() + partialTicks) / 10.0F + item.hoverStart) * 0.1F + 0.2F;
RenderSearchItemBlock.renderSearch(item.lastTickPosX + (item.posX - item.lastTickPosX) * partialTicks, item.lastTickPosY + (item.posY - item.lastTickPosY) * partialTicks + height, item.lastTickPosZ + (item.posZ - item.lastTickPosZ) * partialTicks, entry.getValue(), totalSearchedItemCount);
}
for (int i = 0; i < searchedBlocks.size(); i++) {
if (!searchedBlocks.get(i).renderSearchBlock(totalSearchedItemCount)) {
searchedBlocks.remove(i);
i--;
}
}
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glDisable(GL11.GL_BLEND);
GL11.glDepthMask(true);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
}
示例6: prepare
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
* Prepares for a rendering pass. The depth and colour buffers of the
* current framebuffer are cleared and a few other default settings are set.
*/
private void prepare() {
GL11.glClearColor(0f, 0.66f, 0.94f, 1f);
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
GL32.glProvokingVertex(GL32.GL_FIRST_VERTEX_CONVENTION);
OpenGlUtils.cullBackFaces(true);
OpenGlUtils.enableDepthTesting(true);
OpenGlUtils.antialias(true);
}
示例7: gameLoop
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
private void gameLoop() throws InterruptedException {
double startTime = GLFW.glfwGetTime();
double deltaTime = 0.;
double fpsSleepTime = 0.;
while (running) {
input();
update(deltaTime);
GL11.glClearColor(0.5f, 0.5f, 0.5f, 1.0f);
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
render();
GLFW.glfwSwapBuffers(window);
// FPS calculations
fpsSleepTime = ((1. / (double) (TARGET_FPS)) + startTime - GLFW.glfwGetTime()) * 1000.;
if (fpsSleepTime < 0.)
fpsSleepTime = 0.;
Thread.sleep((long) fpsSleepTime);
deltaTime = GLFW.glfwGetTime() - startTime;
startTime = GLFW.glfwGetTime();
if (deltaTime > 1)
deltaTime = 1;// catch framedrops
// java.lang.System.out.println("FPS: " + (1./deltaTime));
}
}
示例8: prepare
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
* Prepares for a rendering pass. The depth and colour buffers of the
* current framebuffer are cleared and a few other default settings are set.
*/
private void prepare() {
GL11.glClearColor(1f, 1f, 1f, 1f);
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
GL32.glProvokingVertex(GL32.GL_FIRST_VERTEX_CONVENTION);
OpenGlUtils.cullBackFaces(true);
OpenGlUtils.enableDepthTesting(true);
OpenGlUtils.antialias(true);
}
示例9: clearRenderBuffer
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void clearRenderBuffer()
{
if (isShadowPass)
{
checkGLError("shadow clear pre");
EXTFramebufferObject.glFramebufferTexture2DEXT(36160, 36096, 3553, sfbDepthTextures.get(0), 0);
GL11.glClearColor(1.0F, 1.0F, 1.0F, 1.0F);
GL20.glDrawBuffers(programsDrawBuffers[30]);
checkFramebufferStatus("shadow clear");
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
checkGLError("shadow clear");
}
else
{
checkGLError("clear pre");
GL20.glDrawBuffers(36064);
GL11.glClear(16384);
GL20.glDrawBuffers(36065);
GL11.glClearColor(1.0F, 1.0F, 1.0F, 1.0F);
GL11.glClear(16384);
for (int i = 2; i < usedColorBuffers; ++i)
{
GL20.glDrawBuffers(36064 + i);
GL11.glClearColor(0.0F, 0.0F, 0.0F, 0.0F);
GL11.glClear(16384);
}
setDrawBuffers(dfbDrawBuffers);
checkFramebufferStatus("clear");
checkGLError("clear");
}
}
示例10: render
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void render()
{
GL11.glClearColor(SKY_COLOR, SKY_COLOR, SKY_COLOR, 0.0f);
GL11.glClearStencil(0);
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_STENCIL_BUFFER_BIT);
GL11.glColor3f(GROUND_COLOR, GROUND_COLOR, GROUND_COLOR);
GL11.glBegin(GL11.GL_QUADS);
GL11.glVertex3f(-1.0f, -1.0f, 1.0f);
GL11.glVertex3f(-1.0f, 0.0f, 1.0f);
GL11.glVertex3f(1.0f, 0.0f, 1.0f);
GL11.glVertex3f(1.0f, -1.0f, 1.0f);
GL11.glVertex3f(-1.0f, -1.0f, -1.0f);
GL11.glVertex3f(-1.0f, 0.0f, -1.f);
GL11.glVertex3f(1.0f, 0.0f, -1.0f);
GL11.glVertex3f(1.0f, -1.0f, -1.0f);
GL11.glVertex3f(1.0f, -1.0f, -1.0f);
GL11.glVertex3f(1.0f, 0.0f, -1.0f);
GL11.glVertex3f(1.0f, 0.0f, 1.0f);
GL11.glVertex3f(1.0f, -1.0f, 1.0f);
GL11.glVertex3f(-1.0f, -1.0f, -1.0f);
GL11.glVertex3f(-1.0f, 0.0f, -1.0f);
GL11.glVertex3f(-1.0f, 0.0f, 1.0f);
GL11.glVertex3f(-1.0f, -1.0f, 1.0f);
GL11.glVertex3f(-1.0f, -1.0f, -1.0f);
GL11.glVertex3f(-1.0f, -1.0f, 1.0f);
GL11.glVertex3f(1.0f, -1.0f, 1.0f);
GL11.glVertex3f(1.0f, -1.0f, -1.0f);
GL11.glEnd();
}
示例11: 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();
}
示例12: clearScreenBuffer
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void clearScreenBuffer()
{
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
}
示例13: render
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void render(float partialTicks) {
/*
Block block = Block.blocksList[world.getBlockId(x, y, z)];
block.setBlockBoundsBasedOnState(world, x, y, z);
double minX = block.getBlockBoundsMinX();
double minY = block.getBlockBoundsMinY();
double minZ = block.getBlockBoundsMinZ();
double maxX = minX + (block.getBlockBoundsMaxX() - minX) * progress;
double maxY = minY + (block.getBlockBoundsMaxY() - minY) * progress;
double maxZ = minZ + (block.getBlockBoundsMaxX() - minZ) * progress;
*/
double minX = 0;
double minY = 0;
double minZ = 0;
double maxX = 1;
double maxY = 1;
double maxZ = 1;
float progress = (ticksExisted % 20 + partialTicks) / 20;
GL11.glDepthMask(false);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_BLEND);
GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glLineWidth(1.0F);
// GL11.glColor4d(0, 1, 1, progress < 0.5F ? progress + 0.5F : 1.5 - progress);
GL11.glColor4d(0, progress < 0.5F ? progress + 0.5F : 1.5 - progress, 1, 1);
GL11.glPushMatrix();
// GL11.glTranslated(-0.5D, -0.5D, -0.5D);
GL11.glTranslated(pos.getX(), pos.getY(), pos.getZ());
BufferBuilder wr = Tessellator.getInstance().getBuffer();
wr.begin(GL11.GL_LINES, DefaultVertexFormats.POSITION);
wr.pos(minX, minY, minZ).endVertex();
wr.pos(minX, maxY, minZ).endVertex();
wr.pos(minX, minY, maxZ).endVertex();
wr.pos(minX, maxY, maxZ).endVertex();
wr.pos(maxX, minY, minZ).endVertex();
wr.pos(maxX, maxY, minZ).endVertex();
wr.pos(maxX, minY, maxZ).endVertex();
wr.pos(maxX, maxY, maxZ).endVertex();
wr.pos(minX, minY, minZ).endVertex();
wr.pos(maxX, minY, minZ).endVertex();
wr.pos(minX, minY, maxZ).endVertex();
wr.pos(maxX, minY, maxZ).endVertex();
wr.pos(minX, maxY, minZ).endVertex();
wr.pos(maxX, maxY, minZ).endVertex();
wr.pos(minX, maxY, maxZ).endVertex();
wr.pos(maxX, maxY, maxZ).endVertex();
wr.pos(minX, minY, minZ).endVertex();
wr.pos(minX, minY, maxZ).endVertex();
wr.pos(maxX, minY, minZ).endVertex();
wr.pos(maxX, minY, maxZ).endVertex();
wr.pos(minX, maxY, minZ).endVertex();
wr.pos(minX, maxY, maxZ).endVertex();
wr.pos(maxX, maxY, minZ).endVertex();
wr.pos(maxX, maxY, maxZ).endVertex();
Tessellator.getInstance().draw();
GL11.glPopMatrix();
GL11.glEnable(GL11.GL_CULL_FACE);
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glDisable(GL11.GL_BLEND);
GL11.glDepthMask(true);
GL11.glEnable(GL11.GL_TEXTURE_2D);
}
示例14: render
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public void render(float partialTicks) {
double x = pos.getX() + 0.5D;
double y = pos.getY() + 0.5D;
double z = pos.getZ() + 0.5D;
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glPushMatrix();
GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
float red = 0.5F;
float green = 0.5F;
float blue = 1.0F;
float alpha = 0.5F;
GL11.glTranslated(x, y, z);
// for some reason the blend function resets... that's why this line is here.
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
IBlockState state = world.getBlockState(pos);
if (!getBlock().isAir(state, world, pos)) arrowRenderer.render(world, pos, partialTicks);
int targetAcquireProgress = (int) ((ticksExisted - 50) / 0.7F);
GL11.glRotatef(180.0F - Minecraft.getMinecraft().getRenderManager().playerViewY, 0.0F, 1.0F, 0.0F);
GL11.glRotatef(180.0F - Minecraft.getMinecraft().getRenderManager().playerViewX, 1.0F, 0.0F, 0.0F);
if (ticksExisted <= 120 && ticksExisted > 50) {
GL11.glColor4d(0, 1, 0, 0.8D);
RenderProgressBar.render(0D, 0.4D, 1.8D, 0.9D, 0, targetAcquireProgress);
}
GL11.glEnable(GL11.GL_TEXTURE_2D);
if (!getBlock().isAir(state, world, pos)) {
FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
GL11.glColor4d(red, green, blue, alpha);
if (ticksExisted > 120) {
GL11.glScaled(0.02D, 0.02D, 0.02D);
stat.render(-1, -1, partialTicks);
} else if (ticksExisted > 50) {
GL11.glScaled(0.02D, 0.02D, 0.02D);
fontRenderer.drawString("Acquiring Target...", 0, 0, 0x7F7F7F);
fontRenderer.drawString(targetAcquireProgress + "%", 37, 28, 0x002F00);
} else if (ticksExisted < -30) {
GL11.glScaled(0.03D, 0.03D, 0.03D);
stat.render(-1, -1, partialTicks);
fontRenderer.drawString("Lost Target!", 0, 0, 0xFF0000);
}
}
GL11.glPopMatrix();
}
示例15: prepare
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
private void prepare() {
GL11.glClearColor(1, 1, 1, 1);
GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
}