Support texture depth attachments & depth-stencil attachments
This commit is contained in:
parent
c6caf491ab
commit
fb9dceea5e
2 changed files with 21 additions and 0 deletions
|
|
@ -32,7 +32,10 @@ namespace psemek::gfx
|
|||
void color(texture_3d const & tex, int layer, int attachment = 0);
|
||||
void color(texture_2d_array const & tex, int layer, int attachment = 0);
|
||||
void color(renderbuffer const & rb, int attachment = 0);
|
||||
void depth(texture_2d const & tex);
|
||||
void depth(renderbuffer const & rb);
|
||||
void depth_stencil(texture_2d const & tex);
|
||||
void depth_stencil(renderbuffer const & rb);
|
||||
|
||||
GLenum status() const;
|
||||
bool complete() const;
|
||||
|
|
|
|||
|
|
@ -90,7 +90,25 @@ namespace psemek::gfx
|
|||
gl::FramebufferRenderbuffer(gl::DRAW_FRAMEBUFFER, gl::COLOR_ATTACHMENT0 + attachment, gl::RENDERBUFFER, rb.id());
|
||||
}
|
||||
|
||||
void framebuffer::depth(texture_2d const & tex)
|
||||
{
|
||||
bind();
|
||||
gl::FramebufferTexture2D(gl::DRAW_FRAMEBUFFER, gl::DEPTH_ATTACHMENT, gl::TEXTURE_2D, tex.id(), 0);
|
||||
}
|
||||
|
||||
void framebuffer::depth(renderbuffer const & rb)
|
||||
{
|
||||
bind();
|
||||
gl::FramebufferRenderbuffer(gl::DRAW_FRAMEBUFFER, gl::DEPTH_ATTACHMENT, gl::RENDERBUFFER, rb.id());
|
||||
}
|
||||
|
||||
void framebuffer::depth_stencil(texture_2d const & tex)
|
||||
{
|
||||
bind();
|
||||
gl::FramebufferTexture2D(gl::DRAW_FRAMEBUFFER, gl::DEPTH_STENCIL_ATTACHMENT, gl::TEXTURE_2D, tex.id(), 0);
|
||||
}
|
||||
|
||||
void framebuffer::depth_stencil(renderbuffer const & rb)
|
||||
{
|
||||
bind();
|
||||
gl::FramebufferRenderbuffer(gl::DRAW_FRAMEBUFFER, gl::DEPTH_STENCIL_ATTACHMENT, gl::RENDERBUFFER, rb.id());
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue