List of usage examples for org.lwjgl.opengl GL11 glClear
public static void glClear(@NativeType("GLbitfield") int mask)
From source file:spaceshooter.main.SpaceShooter.java
License:Creative Commons License
public void init() { try {// ww w . j a v a 2s .co m Display.setDisplayMode(new DisplayMode(RenderingHelper.xSize, RenderingHelper.ySize)); Display.setTitle("Space Shooter"); Display.sync(60); Display.create(); } catch (LWJGLException e) { e.printStackTrace(); System.exit(0); } GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glLoadIdentity(); GL11.glOrtho(0, RenderingHelper.xSize, 0, RenderingHelper.ySize, 1, -1); GL11.glMatrixMode(GL11.GL_MODELVIEW); while (!Display.isCloseRequested()) { GL11.glClear(GL11.GL_COLOR_BUFFER_BIT); LevelHelper.level.get(level).setup(); LevelHelper.level.get(level).generateLevel(); player.handleInput(); player.draw(); player.onUpdate(); Display.update(); } Display.destroy(); }
From source file:src.graphics.common.Rendering.java
License:Open Source License
public void clearDepth() { addClient(new Client() { public void renderTo(Rendering rendering) { GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); }/*from w w w . j av a 2 s .c o m*/ public int[] GL_disables() { return new int[0]; } }); }
From source file:src.graphics.common.Rendering.java
License:Open Source License
public void renderDisplay() { initSettings();// w w w . ja va2 s . c om final Colour BC = backColour == null ? Colour.DARK_GREY : backColour; GL11.glClearColor(BC.r, BC.g, BC.b, BC.a); GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); port.applyView(); lighting.bindLight(0); for (Client client : clients) { GL11.glColor4f(1, 1, 1, 1); GL11.glMatrixMode(GL11.GL_MODELVIEW); final int disabled[] = client.GL_disables(); if (disabled != null) for (int d : disabled) GL11.glDisable(d); client.renderTo(this); if (disabled != null) for (int d : disabled) GL11.glEnable(d); } clients.clear(); if (HUD != null) { HUD.renderHUD(new Box2D().set(0, 0, viewWide, viewHigh)); } // // TODO: Allow a custom image-tex? final Colour FC = foreColour == null ? Colour.NONE : foreColour; //final Colour FC = Colour.GREY ; FC.bindColour(); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glBegin(GL11.GL_QUADS); UINode.drawQuad(0, 0, viewWide, viewHigh, 0, 0, 1, 1, 0); GL11.glEnd(); Display.update(); }
From source file:structuregenmod.handlers.SGTBlockHighlightHandler.java
License:Open Source License
/** * Highlights the tile located at x/y/z/*from w w w .ja va 2 s .co m*/ */ public static final void highlightTile(EntityPlayer player, double x, double y, double z, float partialTicks, float transparency) { double iPX = player.prevPosX + (player.posX - player.prevPosX) * partialTicks; double iPY = player.prevPosY + (player.posY - player.prevPosY) * partialTicks; double iPZ = player.prevPosZ + (player.posZ - player.prevPosZ) * partialTicks; GL11.glDepthMask(false); GL11.glDisable(GL11.GL_CULL_FACE); GL11.glPushMatrix(); GL11.glTranslated(-iPX + x + 0.5D, -iPY + y + 0.51D, -iPZ + z + 0.5D); GL11.glScalef(1.0F, 1.0F, 1.0F); GL11.glRotatef(90, -1, 0, 0); GL11.glTranslated(0, 0, 0.5f); GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); drawQuad(transparency); GL11.glPopMatrix(); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glDepthMask(true); }
From source file:taiga.gpvm.render.ColoredSky.java
License:Open Source License
@Override protected void renderSky(Matrix4 proj) { GL11.glClearColor(red, green, blue, 1f); GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT | GL11.GL_COLOR_BUFFER_BIT); }
From source file:tectonicus.rasteriser.lwjgl.LwjglRasteriser.java
License:BSD License
@Override public void clear(Color clearColour) { GL11.glClearColor(clearColour.getRed() / 255.0f, clearColour.getGreen() / 255.0f, clearColour.getBlue() / 255.0f, 0); GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT | GL11.GL_STENCIL_BUFFER_BIT); }
From source file:tectonicus.rasteriser.lwjgl.LwjglRasteriser.java
License:BSD License
@Override public void clearDepthBuffer() { GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); }
From source file:thebounzer.org.lwgldemo.Chapter3.java
License:Open Source License
@Override public void loopCycle() { GL11.glClear(GL11.GL_COLOR_BUFFER_BIT); GL20.glUseProgram(program.getId());//from w w w. j a v a 2s . com vaoId = GL30.glGenVertexArrays(); GL30.glBindVertexArray(vaoId); attributesBind(time += 0.01f); GL11.glDrawArrays(GL11.GL_TRIANGLES, 0, 3); GL20.glUseProgram(0); }
From source file:thebounzer.org.lwgldemo.Chapter5.java
License:Open Source License
@Override public void loopCycle() { GL11.glClear(GL11.GL_COLOR_BUFFER_BIT); float f = (float) (time * Math.PI * 0.1f); Matrix4f modelViewM = new Matrix4f(); Matrix4f mat = new Matrix4f(); Matrix4f transOne = new Matrix4f(); Matrix4f transTwo = new Matrix4f(); Matrix4f rotaOne = new Matrix4f(); Matrix4f rotaTwo = new Matrix4f(); Matrix4f.translate(new Vector3f(0.0f, 0.0f, -0.4f), mat, transOne); Matrix4f.translate(new Vector3f((float) Math.sin(2.1f * f) * 0.5f, (float) Math.cos(1.7f * f) * 0.5f, (float) Math.sin(1.3f * f) * (float) Math.cos(1.5 * f) * 2.0f), mat, transTwo); Matrix4f.rotate(time * 45.0f, new Vector3f(0.0f, 1.0f, 0.0f), mat, rotaOne); Matrix4f.rotate(time * 81.0f, new Vector3f(1.0f, 0.0f, 0.0f), mat, rotaTwo); Matrix4f.mul(modelViewM, transOne, modelViewM); Matrix4f.mul(modelViewM, transTwo, modelViewM); Matrix4f.mul(modelViewM, rotaOne, modelViewM); Matrix4f.mul(modelViewM, rotaTwo, modelViewM); GL20.glUseProgram(program.getId());/* w w w .ja va2 s . co m*/ FloatBuffer matrixBuf = BufferUtils.createFloatBuffer(16); modelViewM.store(matrixBuf); matrixBuf.flip(); int uniLoc = GL20.glGetUniformLocation(program.getId(), "mv_matrix"); GL20.glUniformMatrix4(uniLoc, false, matrixBuf); int uniProjMatLoc = GL20.glGetUniformLocation(program.getId(), "proj_matrix"); GL20.glUniformMatrix4(uniProjMatLoc, false, matrixBuf); vaoId = GL30.glGenVertexArrays(); GL30.glBindVertexArray(vaoId); GL11.glDrawArrays(GL11.GL_POINTS, 0, 36); GL20.glUseProgram(0); time += 0.001f; }
From source file:tk.ivybits.engine.gl.GL.java
License:Open Source License
public static void glClear(int a) { GL11.glClear(a); }