Example usage for org.lwjgl.opengl GL11 glClear

List of usage examples for org.lwjgl.opengl GL11 glClear

Introduction

In this page you can find the example usage for org.lwjgl.opengl GL11 glClear.

Prototype

public static void glClear(@NativeType("GLbitfield") int mask) 

Source Link

Document

Sets portions of every pixel in a particular buffer to the same value.

Usage

From source file:org.spoutcraft.api.gui.renderer.GuiRendererFBO.java

License:MIT License

@Override
public void drawScreen(Gui gui, RootContainer root, int mouseX, int mouseY, float partialTick) {
    GL11.glPushAttrib(GL11.GL_STENCIL_BUFFER_BIT);
    GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, fbo);
    GL11.glClearColor(0, 0, 0, 0F);//  w  w w .  j  ava 2 s.c om
    GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT | GL11.GL_STENCIL_BUFFER_BIT);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GL11.glEnable(GL11.GL_STENCIL_TEST);
    root.render();

    GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, 0);

    TextureUtil.bind(guiTex);

    GL11.glDisable(GL11.GL_BLEND);
    Tessellator tes = Tessellator.instance;
    tes.startDrawingQuads();
    tes.addVertexWithUV(0, 0, 0, 0, 1);
    tes.addVertexWithUV(0, gui.height, 0, 0, 0);
    tes.addVertexWithUV(gui.width, gui.height, 0, 1, 0);
    tes.addVertexWithUV(gui.width, 0, 0, 1, 1);
    tes.draw();
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glPopAttrib();
}

From source file:org.spoutcraft.api.gui.renderer.GuiRendererFBO.java

License:MIT License

@Override
public void clearClip() {
    GL11.glClear(GL11.GL_STENCIL_BUFFER_BIT);
}

From source file:org.terasology.rendering.opengl.LwjglFrameBufferObject.java

License:Apache License

public LwjglFrameBufferObject(AssetUri uri, Vector2i size) {
    this.size = size;

    IntBuffer fboId = BufferUtils.createIntBuffer(1);
    GL30.glGenFramebuffers(fboId);//from ww w.  ja  va  2s. c om
    frame = fboId.get(0);

    Texture texture = generateTexture(uri);

    GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, frame);
    GL30.glFramebufferTexture2D(GL30.GL_FRAMEBUFFER, GL30.GL_COLOR_ATTACHMENT0, GL11.GL_TEXTURE_2D,
            texture.getId(), 0);

    int result = GL30.glCheckFramebufferStatus(GL30.GL_FRAMEBUFFER);
    if (result != GL30.GL_FRAMEBUFFER_COMPLETE) {
        throw new IllegalStateException("Something went wrong with framebuffer! " + result);
    }

    GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);

    GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, 0);
}

From source file:org.voxels.platform.LWJGLOpenGLAdapter.java

License:Open Source License

@Override
public void glClear(final int mask) {
    GL11.glClear(mask);
}

From source file:org.xmlvm.iphone.gl.GL.java

License:Open Source License

public static void glClear(int buffer) {
    GL11.glClear(buffer);
}

From source file:playn.java.JavaGL20.java

License:Apache License

@Override
public void glClear(int mask) {
    GL11.glClear(mask);
}

From source file:processing.lwjgl.PLWJGL.java

License:Open Source License

public void clear(int buf) {
    GL11.glClear(buf);
}

From source file:processing.opengl.PLWJGL.java

License:Open Source License

@Override
public void clear(int buf) {
    GL11.glClear(buf);
}

From source file:rainet.Game.java

@Override
public void run() {
    try {//from   ww w .  j  ava2 s.  co m
        initGL(this.st_w, this.st_h, this.st_t);
        init(this.st_s);
        System.out.println("proceed");
        System.out.println(this.gBoard == null);
        sOutput.writeByte(3);
        while (true) {
            GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
            pollInput();

            //readServerValues();
            render();
            Display.update();
            Display.sync(100);
            if (Display.isCloseRequested()) {
                client.close();
                Display.destroy();
                System.exit(0);
            }
        }
    } catch (IOException e) {
        System.out.println("epic fail");
    }
}

From source file:render.Render.java

License:Open Source License

public void StartRender() {

    if (flag)/*www. j ava2 s .c om*/
        this.resetGL();
    flag = false;

    GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_STENCIL_BUFFER_BIT);
    GL11.glClear(GL11.GL_COLOR_BUFFER_BIT);
    GL11.glClearColor(1.0F, 1.0F, 1.0F, 1.0F);

    GL11.glColor3d(0.0F, 0.0F, 0.0F);
    GL11.glPushMatrix();
    GL11.glScaled(Normal.toPlan(1), Normal.toPlan(1), 1);
    GL11.glTranslated(Normal.rx, Normal.ry, 0);
    // double zoom = 0.00001;
    // GL11.glOrtho( -width/2*zoom, width/2*zoom, -height/2*zoom, height/2*zoom, -1, 1 );

    GL11.glColor3d(0.4, 0.9, 0.1);

    //TODO : Make color class with getGreenFloat and getGreenRGB and chromatic wheel
    // this.drawLine(new Point(20,20), new Point(20+100,20));
    //FasT.getFasT().getLogger().debug("1 meter = " + Normal.normal(100, Unit.cm));
    // this.drawLine(new Point(20,40), new Point(20+Normal.toPlan(1),40));
    GL11.glColor3d(0, 1, 0);
    this.drawSquare(new Point(-1, -1).toReal(), new Point(1, 1).toReal());

    // this.drawLine(new Point(1,1).toReal(), new Point(1,1).toReal().add(new Point(1,0)));
    // this.drawLine(new Point(1,10), new Point(20,10));

    GL11.glColor3d(0.02, 0.8, 0.95);
    this.drawLine(new Point(10, 10).mouseToReal(), new Point(10, 10).mouseToReal().add(new Point(1, 0)));

    //Draw text to show this is 1 meter
}