Java Code Examples for com.jogamp.opengl.GL4#glNamedFramebufferTexture()

The following examples show how to use com.jogamp.opengl.GL4#glNamedFramebufferTexture() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Gl_450_direct_state_access.java    From jogl-samples with MIT License 6 votes vote down vote up
private boolean initFramebuffer(GL4 gl4) {

        gl4.glCreateFramebuffers(Framebuffer.MAX, framebufferName);
        gl4.glNamedFramebufferTexture(framebufferName.get(Framebuffer.RENDER), GL_COLOR_ATTACHMENT0,
                textureName.get(Texture.MULTISAMPLE), 0);
        gl4.glNamedFramebufferTexture(framebufferName.get(Framebuffer.RESOLVE), GL_COLOR_ATTACHMENT0,
                textureName.get(Texture.COLORBUFFER), 0);

        if (gl4.glCheckNamedFramebufferStatus(framebufferName.get(Framebuffer.RENDER), GL_FRAMEBUFFER)
                != GL_FRAMEBUFFER_COMPLETE) {
            return false;
        }
        if (gl4.glCheckNamedFramebufferStatus(framebufferName.get(Framebuffer.RESOLVE), GL_FRAMEBUFFER)
                != GL_FRAMEBUFFER_COMPLETE) {
            return false;
        }

        IntBuffer params = GLBuffers.newDirectIntBuffer(1);
        gl4.glGetNamedFramebufferParameteriv(framebufferName.get(Framebuffer.RENDER), GL_SAMPLES, params);
        int samples = params.get(0);
        BufferUtils.destroyDirectBuffer(params);
        return samples == 4;

    }
 
Example 2
Source File: Gl_500_direct_state_access_gtc.java    From jogl-samples with MIT License 6 votes vote down vote up
private boolean initFramebuffer(GL4 gl4) {

        gl4.glCreateFramebuffers(Framebuffer.MAX, framebufferName);
        gl4.glNamedFramebufferTexture(framebufferName.get(Framebuffer.RENDER), GL_COLOR_ATTACHMENT0,
                textureName.get(Texture.MULTISAMPLE), 0);
        gl4.glNamedFramebufferTexture(framebufferName.get(Framebuffer.RESOLVE), GL_COLOR_ATTACHMENT0,
                textureName.get(Texture.COLORBUFFER), 0);

        if (gl4.glCheckNamedFramebufferStatus(framebufferName.get(Framebuffer.RENDER), GL_FRAMEBUFFER)
                != GL_FRAMEBUFFER_COMPLETE) {
            return false;
        }
        if (gl4.glCheckNamedFramebufferStatus(framebufferName.get(Framebuffer.RESOLVE), GL_FRAMEBUFFER)
                != GL_FRAMEBUFFER_COMPLETE) {
            return false;
        }

        return true;
    }
 
Example 3
Source File: Gl_430_direct_state_access_ext.java    From jogl-samples with MIT License 5 votes vote down vote up
private boolean initFramebuffer(GL4 gl4) {

        gl4.glCreateFramebuffers(Framebuffer.MAX, framebufferName);
        gl4.glNamedFramebufferTexture(framebufferName.get(Framebuffer.RENDER), GL_COLOR_ATTACHMENT0,
                textureName.get(Texture.MULTISAMPLE), 0);
        gl4.glNamedFramebufferTexture(framebufferName.get(Framebuffer.RESOLVE), GL_COLOR_ATTACHMENT0,
                textureName.get(Texture.COLORBUFFER), 0);

        if (gl4.glCheckNamedFramebufferStatus(framebufferName.get(Framebuffer.RENDER), GL_FRAMEBUFFER)
                != GL_FRAMEBUFFER_COMPLETE) {
            return false;
        }
        return gl4.glCheckNamedFramebufferStatus(framebufferName.get(Framebuffer.RESOLVE), GL_FRAMEBUFFER)
                == GL_FRAMEBUFFER_COMPLETE;
    }
 
Example 4
Source File: Gl_500_conservative_raster_nv.java    From jogl-samples with MIT License 5 votes vote down vote up
private boolean initFramebuffer(GL4 gl4) {

        gl4.glCreateFramebuffers(1, framebufferName);
        gl4.glNamedFramebufferTexture(framebufferName.get(0), GL_COLOR_ATTACHMENT0, textureName.get(Texture.COLORBUFFER),
                0);

        return isFramebufferComplete(gl4, framebufferName.get(0));
    }
 
Example 5
Source File: Gl_500_shader_group_nv.java    From jogl-samples with MIT License 5 votes vote down vote up
private boolean initFramebuffer(GL4 gl4) {

        gl4.glCreateFramebuffers(1, framebufferName);
        gl4.glNamedFramebufferTexture(framebufferName.get(0), GL_COLOR_ATTACHMENT0, textureName.get(Texture.COLORBUFFER),
                0);
        gl4.glNamedFramebufferTexture(framebufferName.get(0), GL_DEPTH_ATTACHMENT, textureName.get(Texture.RENDERBUFFER),
                0);

        return gl4.glCheckNamedFramebufferStatus(framebufferName.get(0), GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE;
    }