Example usage for org.lwjgl.opengl GL30 glBindFramebuffer

List of usage examples for org.lwjgl.opengl GL30 glBindFramebuffer

Introduction

In this page you can find the example usage for org.lwjgl.opengl GL30 glBindFramebuffer.

Prototype

public static void glBindFramebuffer(@NativeType("GLenum") int target, @NativeType("GLuint") int framebuffer) 

Source Link

Document

Binds a framebuffer to a framebuffer target.

Usage

From source file:com.adavr.player.globjects.Framebuffer.java

License:Open Source License

public static void bind(Framebuffer fb) {
    GL30.glBindFramebuffer(fb.target, fb.id);
}

From source file:com.adavr.player.globjects.Framebuffer.java

License:Open Source License

public static void unbind(Framebuffer fb) {
    GL30.glBindFramebuffer(fb.target, 0);
}

From source file:com.badlogic.gdx.backends.jglfw.JglfwGL30.java

License:Apache License

@Override
public void glBindFramebuffer(int target, int framebuffer) {
    GL30.glBindFramebuffer(target, framebuffer);
}

From source file:com.flowpowered.caustic.lwjgl.gl30.GL30FrameBuffer.java

License:MIT License

@Override
public void create() {
    checkNotCreated();/*from w w w  . j a  va2  s .  com*/
    // Generate and bind the frame buffer
    id = GL30.glGenFramebuffers();
    GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, id);
    // Disable input buffers
    GL11.glReadBuffer(GL11.GL_NONE);
    // Unbind the frame buffer
    GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, 0);
    // Update the state
    super.create();
    // Check for errors
    LWJGLUtil.checkForGLError();
}

From source file:com.flowpowered.caustic.lwjgl.gl30.GL30FrameBuffer.java

License:MIT License

@Override
public void attach(AttachmentPoint point, Texture texture) {
    checkCreated();//  w w w . jav  a  2s .  c  om
    CausticUtil.checkVersion(this, texture);
    texture.checkCreated();
    // Bind the frame buffer
    GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, id);
    // Attach the texture
    GL30.glFramebufferTexture2D(GL30.GL_FRAMEBUFFER, point.getGLConstant(), GL11.GL_TEXTURE_2D, texture.getID(),
            0);
    // Add it to the color outputs if it's a color type
    if (point.isColor()) {
        outputBuffers.add(point.getGLConstant());
    }
    // Update the list of output buffers
    updateOutputBuffers();
    // Unbind the frame buffer
    GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, 0);
    // Check for errors
    LWJGLUtil.checkForGLError();
}

From source file:com.flowpowered.caustic.lwjgl.gl30.GL30FrameBuffer.java

License:MIT License

@Override
public void attach(AttachmentPoint point, RenderBuffer buffer) {
    checkCreated();/*from  ww  w  .ja v  a  2  s .  c  om*/
    CausticUtil.checkVersion(this, buffer);
    buffer.checkCreated();
    // Bind the frame buffer
    GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, id);
    // Attach the render buffer
    GL30.glFramebufferRenderbuffer(GL30.GL_FRAMEBUFFER, point.getGLConstant(), GL30.GL_RENDERBUFFER,
            buffer.getID());
    // Add it to the color outputs if it's a color type
    if (point.isColor()) {
        outputBuffers.add(point.getGLConstant());
    }
    // Update the list of output buffers
    updateOutputBuffers();
    // Unbind the frame buffer
    GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, 0);
    // Check for errors
    LWJGLUtil.checkForGLError();
}

From source file:com.flowpowered.caustic.lwjgl.gl30.GL30FrameBuffer.java

License:MIT License

@Override
public void detach(AttachmentPoint point) {
    checkCreated();/*w w w  . j av  a2s.co m*/
    // Bind the frame buffer
    GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, id);
    // Detach the render buffer
    GL30.glFramebufferRenderbuffer(GL30.GL_FRAMEBUFFER, point.getGLConstant(), GL30.GL_RENDERBUFFER, 0);
    // Remove it from the color outputs if it's a color type
    if (point.isColor()) {
        outputBuffers.remove(point.getGLConstant());
    }
    // Update the list of output buffers
    updateOutputBuffers();
    // Unbind the frame buffer
    GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, 0);
    // Check for errors
    LWJGLUtil.checkForGLError();
}

From source file:com.flowpowered.caustic.lwjgl.gl30.GL30FrameBuffer.java

License:MIT License

@Override
public boolean isComplete() {
    checkCreated();/*  w ww  .j  a v a2 s  .c  om*/
    // Bind the frame buffer
    GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, id);
    // Fetch the status and compare to the complete enum value
    final boolean complete = GL30.glCheckFramebufferStatus(GL30.GL_FRAMEBUFFER) == GL30.GL_FRAMEBUFFER_COMPLETE;
    // Unbind the frame buffer
    GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, 0);
    // Check for errors
    LWJGLUtil.checkForGLError();
    return complete;
}

From source file:com.flowpowered.caustic.lwjgl.gl30.GL30FrameBuffer.java

License:MIT License

@Override
public void bind() {
    checkCreated();/*w w w  .j a  va 2 s .c  o  m*/
    // Bind the frame buffer
    GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, id);
    // Check for errors
    LWJGLUtil.checkForGLError();
}

From source file:com.flowpowered.caustic.lwjgl.gl30.GL30FrameBuffer.java

License:MIT License

@Override
public void unbind() {
    checkCreated();/*from www.  ja va  2 s. com*/
    // Unbind the frame buffer
    GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, 0);
    // Check for errors
    LWJGLUtil.checkForGLError();
}