public void clearColorBuffer(int color) { float r, g, b, a; int ir, ig, ib, ia; ia = (color >> 24) & 0xff; ir = (color >> 16) & 0xff; ig = (color >> 8) & 0xff; ib = color & 0xff; a = ia / 255.0f; r = ir / 255.0f; g = ig / 255.0f; b = ib / 255.0f; gl.glClearColor(r, g, b, a); gl.glClear(GL.GL_COLOR_BUFFER_BIT); }
public void init(GLAutoDrawable drawable) { GL gl = drawable.getGL(); float m[] = { 0.0f, 1.0f, 0.0f, 0.0f, // 0.0f, 0.0f, 1.0f, 0.0f, // 1.0f, 0.0f, 0.0f, 0.0f, // 0.0f, 0.0f, 0.0f, 1.0f }; pixels = readImage("Data/leeds.bin", dim); System.out.println(pixels.toString()); gl.glPixelStorei(GL.GL_UNPACK_ALIGNMENT, 1); gl.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); gl.glMatrixMode(GL.GL_COLOR); gl.glLoadMatrixf(m, 0); gl.glMatrixMode(GL.GL_MODELVIEW); }
public void clearTex(int glid, int target, int color) { float r, g, b, a; int ir, ig, ib, ia; ia = (color >> 24) & 0xff; ir = (color >> 16) & 0xff; ig = (color >> 8) & 0xff; ib = color & 0xff; a = ia / 255.0f; r = ir / 255.0f; g = ig / 255.0f; b = ib / 255.0f; pushFramebuffer(); setFramebuffer(FBO); FBO.setDrawBuffer(target, glid); gl.glClearColor(r, g, b, a); gl.glClear(GL.GL_COLOR_BUFFER_BIT); popFramebuffer(); }