Example usage for org.lwjgl.opengl GL11 glDrawBuffer

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

Introduction

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

Prototype

public static void glDrawBuffer(@NativeType("GLenum") int buf) 

Source Link

Document

Defines the color buffer to which fragment color zero is written.

Usage

From source file:net.smert.frameworkgl.opengl.helpers.FrameBufferObjectHelper.java

License:Apache License

public void disableBuffers() {
    GL11.glDrawBuffer(GL11.GL_NONE);
    GL11.glReadBuffer(GL11.GL_NONE);
}

From source file:net.smert.frameworkgl.opengl.helpers.FrameBufferObjectHelper.java

License:Apache License

public void disableDrawBuffer() {
    GL11.glDrawBuffer(GL11.GL_NONE);
}

From source file:net.smert.frameworkgl.opengl.helpers.FrameBufferObjectHelper.java

License:Apache License

public void drawBuffer(int mode) {
    GL11.glDrawBuffer(mode);
}

From source file:org.free.jake2.render.lwjgl.Main.java

License:Open Source License

/**
 * R_BeginFrame//w  ww  . ja v  a  2s . c om
 */
protected void R_BeginFrame(float camera_separation) {

    gl_state.camera_separation = camera_separation;

    /*
     ** change modes if necessary
     */
    if (gl_mode.modified || vid_fullscreen.modified) {
        // FIXME: only restart if CDS is required
        cvar ref;

        ref = Cvar.Get("vid_ref", "lwjgl", 0);
        ref.modified = true;
    }

    if (gl_log.modified) {
        GLimp_EnableLogging((gl_log.value != 0.0f));
        gl_log.modified = false;
    }

    if (gl_log.value != 0.0f) {
        GLimp_LogNewFrame();
    }

    /*
     ** update 3Dfx gamma -- it is expected that a user will do a vid_restart
     ** after tweaking this value
     */
    if (vid_gamma.modified) {
        vid_gamma.modified = false;

        if ((gl_config.renderer & GL_RENDERER_VOODOO) != 0) {
            // wird erstmal nicht gebraucht

            /*
            char envbuffer[1024];
            float g;
                    
            g = 2.00 * ( 0.8 - ( vid_gamma->value - 0.5 ) ) + 1.0F;
            Com_sprintf( envbuffer, sizeof(envbuffer), "SSTV2_GAMMA=%f", g );
            putenv( envbuffer );
            Com_sprintf( envbuffer, sizeof(envbuffer), "SST_GAMMA=%f", g );
            putenv( envbuffer );
             */
            VID.Printf(Defines.PRINT_DEVELOPER, "gamma anpassung fuer VOODOO nicht gesetzt");
        }
    }

    GLimp_BeginFrame(camera_separation);

    /*
     ** go into 2D mode
     */
    GL11.glViewport(0, 0, vid.width, vid.height);
    GL11.glMatrixMode(GL11.GL_PROJECTION);
    GL11.glLoadIdentity();
    GL11.glOrtho(0, vid.width, vid.height, 0, -99999, 99999);
    GL11.glMatrixMode(GL11.GL_MODELVIEW);
    GL11.glLoadIdentity();
    GL11.glDisable(GL11.GL_DEPTH_TEST);
    GL11.glDisable(GL11.GL_CULL_FACE);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glEnable(GL11.GL_ALPHA_TEST);
    GL11.glColor4f(1, 1, 1, 1);

    /*
     ** draw buffer stuff
     */
    if (gl_drawbuffer.modified) {
        gl_drawbuffer.modified = false;

        if (gl_state.camera_separation == 0 || !gl_state.stereo_enabled) {
            if (gl_drawbuffer.string.equalsIgnoreCase("GL_FRONT")) {
                GL11.glDrawBuffer(GL11.GL_FRONT);
            } else {
                GL11.glDrawBuffer(GL11.GL_BACK);
            }
        }
    }

    /*
     ** texturemode stuff
     */
    if (gl_texturemode.modified) {
        GL_TextureMode(gl_texturemode.string);
        gl_texturemode.modified = false;
    }

    if (gl_texturealphamode.modified) {
        GL_TextureAlphaMode(gl_texturealphamode.string);
        gl_texturealphamode.modified = false;
    }

    if (gl_texturesolidmode.modified) {
        GL_TextureSolidMode(gl_texturesolidmode.string);
        gl_texturesolidmode.modified = false;
    }

    /*
     ** swapinterval stuff
     */
    GL_UpdateSwapInterval();

    //
    // clear screen if desired
    //
    R_Clear();
}

From source file:org.spout.engine.filesystem.resource.ClientRenderTexture.java

License:Open Source License

public void release() {

    if (framebuffer != INVALID_BUFFER) {
        if (useEXT) {
            EXTFramebufferObject.glBindFramebufferEXT(EXTFramebufferObject.GL_FRAMEBUFFER_EXT, SCREEN_BUFFER);
        } else {//  w  w w. j  av a 2s .  com
            GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, SCREEN_BUFFER);
        }
        SpoutRenderer.checkGLError();

        GL11.glViewport(0, 0, width, height);
        SpoutRenderer.checkGLError();

        GL11.glDrawBuffer(GL11.GL_BACK);
    }
}

From source file:processing.lwjgl.PGL.java

License:Open Source License

public void drawBuffer(int buf) {
    GL11.glDrawBuffer(buf);
}

From source file:processing.opengl.PLWJGL.java

License:Open Source License

@Override
public void drawBuffer(int buf) {
    GL11.glDrawBuffer(buf);
}

From source file:tk.ivybits.engine.gl.GL.java

License:Open Source License

public static void glDrawBuffer(int a) {
    GL11.glDrawBuffer(a);
}

From source file:zsawyer.mods.stereoscopic3d.renderers.StencilingRenderer.java

License:Open Source License

protected void prepareStencilBuffer() {
    GL11.glDrawBuffer(GL11.GL_BACK);
    GL11.glEnable(GL11.GL_STENCIL_TEST);
    GL11.glStencilMask(0xff);//  w  ww. j ava  2  s . c om
    GL11.glClearStencil(0);
    GL11.glClear(GL11.GL_STENCIL_BUFFER_BIT);// | GL11.GL_COLOR_BUFFER_BIT
    // | GL11.GL_DEPTH_BUFFER_BIT);

    GL11.glStencilOp(GL11.GL_REPLACE, GL11.GL_REPLACE, GL11.GL_REPLACE);
    // to avoid interaction with stencil content
    GL11.glStencilFunc(GL11.GL_ALWAYS, 1, 0x01);
}

From source file:zsawyer.mods.stereoscopic3d.renderers.StencilingRenderer.java

License:Open Source License

protected void setupImage(int stencilFunc) {
    GL11.glDrawBuffer(GL11.GL_BACK);
    GL11.glStencilFunc(stencilFunc, 1, 0x01);
    // Clear the screen and depth buffer
    GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);// | GL11.GL_COLOR_BUFFER_BIT);
}