Example usage for org.lwjgl.opengl GL32 glFramebufferTexture

List of usage examples for org.lwjgl.opengl GL32 glFramebufferTexture

Introduction

In this page you can find the example usage for org.lwjgl.opengl GL32 glFramebufferTexture.

Prototype

public static void glFramebufferTexture(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment,
        @NativeType("GLuint") int texture, @NativeType("GLint") int level) 

Source Link

Document

Attaches a level of a texture object as a logical buffer to the currently bound framebuffer object.

Usage

From source file:com.xrbpowered.gl.res.buffers.MultisampleBuffers.java

License:Open Source License

protected void create(int w, int h, int samples, boolean depthBuffer, boolean hdr) {
    colorMSTexId = GL11.glGenTextures();
    GL11.glBindTexture(GL32.GL_TEXTURE_2D_MULTISAMPLE, colorMSTexId);
    GL32.glTexImage2DMultisample(GL32.GL_TEXTURE_2D_MULTISAMPLE, samples, hdr ? GL30.GL_RGB16F : GL11.GL_RGB, w,
            h, false);//w  w  w  . ja v a 2  s  .  c o  m
    GL11.glBindTexture(GL32.GL_TEXTURE_2D_MULTISAMPLE, 0);
    GL32.glFramebufferTexture(GL30.GL_FRAMEBUFFER, GL30.GL_COLOR_ATTACHMENT0, colorMSTexId, 0);

    depthMSTexId = 0;
    if (depthBuffer) {
        depthMSTexId = GL11.glGenTextures();
        GL11.glBindTexture(GL32.GL_TEXTURE_2D_MULTISAMPLE, depthMSTexId);
        GL32.glTexImage2DMultisample(GL32.GL_TEXTURE_2D_MULTISAMPLE, samples, GL30.GL_DEPTH24_STENCIL8, w, h,
                false);
        GL11.glBindTexture(GL32.GL_TEXTURE_2D_MULTISAMPLE, 0);
        GL32.glFramebufferTexture(GL30.GL_FRAMEBUFFER, GL30.GL_DEPTH_ATTACHMENT, depthMSTexId, 0);
    }
    checkStatus();
    GL30.glBindFramebuffer(GL30.GL_FRAMEBUFFER, 0);
}

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

License:Open Source License

public static void glFramebufferTexture(int a, int b, int c, int d) {
    GL32.glFramebufferTexture(a, b, c, d);
}