Skip to content

Vp::DepthAttachment

Depth attachment using a Renderbuffer.

#include "Viewport/framebuffer/DepthAttachment.h"

Public Functions

Name
DepthAttachment(bool stencil, GLsizei width, GLsizei height, bool useRenderbuffer)<br>Creates a depth buffer using a 2D texture or read-only renderbuffer.
DepthAttachment(const DepthAttachment & attchmt)<br>Copy constructor // TODO: (DR)(CRIT) Update this.
voidbind() const
voidcreate()
voiddispose()
voidresize(int width, int height)

Public Attributes

Name
intm_height <br>Height in pixels.
GLuintm_id <br>ID of the created object (renderbuffer or texture)
GLintm_magFilter
GLintm_minFilter
boolm_multisampled <br>Use MSAA texture.
unsigned intm_samples <br>Number of MSAA samples if multisampled.
boolm_stencil <br>Whether the specified depth format includes a stencil buffer.
boolm_syncSize
GLintm_textureWrapS
GLintm_textureWrapT
boolm_useRenderbuffer
intm_width <br>Width in pixels.

Public Functions Documentation

function DepthAttachment

cpp
DepthAttachment(
    bool stencil,
    GLsizei width,
    GLsizei height,
    bool useRenderbuffer
)
DepthAttachment(
    bool stencil,
    GLsizei width,
    GLsizei height,
    bool useRenderbuffer
)

Creates a depth buffer using a 2D texture or read-only renderbuffer.

Parameters:

  • useRenderbuffer Whether to use a renderbuffer or a 2D texture for storage.

function DepthAttachment

cpp
DepthAttachment(
    const DepthAttachment & attchmt
)
DepthAttachment(
    const DepthAttachment & attchmt
)

Copy constructor // TODO: (DR)(CRIT) Update this.

function bind

cpp
void bind() const
void bind() const

function create

cpp
void create()
void create()

function dispose

cpp
void dispose()
void dispose()

function resize

cpp
void resize(
    int width,
    int height
)
void resize(
    int width,
    int height
)

Public Attributes Documentation

variable m_height

cpp
int m_height;
int m_height;

Height in pixels.

variable m_id

cpp
GLuint m_id {0};
GLuint m_id {0};

ID of the created object (renderbuffer or texture)

variable m_magFilter

cpp
GLint m_magFilter {GL_NEAREST};
GLint m_magFilter {GL_NEAREST};

variable m_minFilter

cpp
GLint m_minFilter {GL_NEAREST};
GLint m_minFilter {GL_NEAREST};

variable m_multisampled

cpp
bool m_multisampled {false};
bool m_multisampled {false};

Use MSAA texture.

variable m_samples

cpp
unsigned int m_samples {4};
unsigned int m_samples {4};

Number of MSAA samples if multisampled.

variable m_stencil

cpp
bool m_stencil;
bool m_stencil;

Whether the specified depth format includes a stencil buffer.

variable m_syncSize

cpp
bool m_syncSize {true};
bool m_syncSize {true};

variable m_textureWrapS

cpp
GLint m_textureWrapS {GL_REPEAT};
GLint m_textureWrapS {GL_REPEAT};

variable m_textureWrapT

cpp
GLint m_textureWrapT {GL_REPEAT};
GLint m_textureWrapT {GL_REPEAT};

variable m_useRenderbuffer

cpp
bool m_useRenderbuffer {true};
bool m_useRenderbuffer {true};

variable m_width

cpp
int m_width;
int m_width;

Width in pixels.


Updated on 2024-03-16 at 19:15:01 +0000