Example usage for org.lwjgl.opengl GL11 glClearColor

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

Introduction

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

Prototype

public static void glClearColor(@NativeType("GLfloat") float red, @NativeType("GLfloat") float green,
        @NativeType("GLfloat") float blue, @NativeType("GLfloat") float alpha) 

Source Link

Document

Sets the clear value for fixed-point and floating-point color buffers in RGBA mode.

Usage

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

License:Open Source License

public static void glClearColor(float f, float g, float h, float i) {
    GL11.glClearColor(f, g, h, i);
}

From source file:playn.java.JavaGL20.java

License:Apache License

@Override
public void glClearColor(float red, float green, float blue, float alpha) {
    GL11.glClearColor(red, green, blue, alpha);
}

From source file:processing.lwjgl.PGL.java

License:Open Source License

public void clearColor(float r, float g, float b, float a) {
    GL11.glClearColor(r, g, b, a);
}

From source file:processing.opengl.PLWJGL.java

License:Open Source License

@Override
public void clearColor(float r, float g, float b, float a) {
    GL11.glClearColor(r, g, b, a);
}

From source file:rainet.Game.java

private void initGL(int width, int height, String title) {
    try {//w  ww. j  av a 2s.  c o m
        Display.setDisplayMode(new DisplayMode(width, height));
        Display.setLocation(6, 7);
        Display.setTitle(title);
        Display.create();
        Display.setVSyncEnabled(true);
    } catch (LWJGLException e) {
        e.printStackTrace();
        System.exit(0);
    }
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

    GL11.glViewport(0, 0, width, height);
    GL11.glMatrixMode(GL11.GL_MODELVIEW);
    GL11.glMatrixMode(GL11.GL_PROJECTION);
    GL11.glLoadIdentity();
    GL11.glOrtho(0, width, height, 0, 1, -1);
    GL11.glMatrixMode(GL11.GL_MODELVIEW);
}

From source file:render.Render.java

License:Open Source License

public void StartRender() {

    if (flag)//w w  w. j  av a2 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
}

From source file:rtype.Prototyp.java

License:Open Source License

private void initGL() {

    GL11.glEnable(GL11.GL_TEXTURE_2D); // Enable Texture Mapping

    GL11.glClearColor(0.0f, 0.0f, 0.0f, 0.0f); // Black Background
    GL11.glClearDepth(1.0f); // Depth Buffer Setup
    GL11.glDisable(GL11.GL_DEPTH_TEST); // Enables Depth Testing
    GL11.glEnable(GL11.GL_BLEND);/*from  ww w .j  a  v a2s  . c  o m*/
    GL11.glDepthMask(false);
    GL11.glMatrixMode(GL11.GL_PROJECTION); // Select The Projection Matrix
    GL11.glLoadIdentity(); // Reset The Projection Matrix

    GLU.gluOrtho2D(-(int) SCREEN_WIDTH / 2, (int) SCREEN_WIDTH / 2, (int) -SCREEN_HEIGHT / 2,
            (int) SCREEN_HEIGHT / 2);

    GL11.glMatrixMode(GL11.GL_MODELVIEW);

    if (useDevil)
        ;//textureLoader = new DevilTextureLoader();
    else {
        textureLoader = new WorkAroundTextureLoader();
    }
    textureLoader.init();
}

From source file:ru.axialshift.display.Processor.java

License:Apache License

private void preconfigureOGL() {
    GL11.glClearColor(0.4f, 0.6f, 0.9f, 0f);
    GL11.glViewport(0, 0, Display.getWidth(), Display.getHeight());
}

From source file:se.angergard.engine.graphics.RenderUtil.java

License:Apache License

/** @param red The red component 0f - 1.0f
 * @param green The green component 0f - 1.0f
 * @param blue The blue component 0f - 1.0f
 * @param alpha *//*from   w w  w .j  a v a  2 s  .co  m*/
public static void setClearColor(float red, float green, float blue, float alpha) {
    GL11.glClearColor(red, green, blue, alpha);
}

From source file:shadowmage.meim.client.gui.GuiModelEditor.java

License:Open Source License

@Override
public void renderExtraBackGround(int mouseX, int mouseY, float partialTime) {
    GL11.glClearColor(.2f, .2f, .2f, 1.f);
    GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT);
    setupModelView();//from w  ww.j a  v  a2s .c o  m
    if (model != null && doSelection) {
        this.doSelection();
        doSelection = false;
    }
    renderGrid();
    enableModelLighting();
    if (model != null) {
        TextureManager.bindTexture();
        model.renderForEditor(getSelectedPiece(), getSelectedPrimitive());//.renderModel();
        TextureManager.resetBoundTexture();
    }
    resetModelView();
}