Skip to content

Vp::ColorAttachment

Color attachment using a 2D Texture.

#include "Viewport/framebuffer/ColorAttachment.h"

Public Functions

Name
ColorAttachment(const ColorAttachment & attchmt)<br>Copy constructor.
ColorAttachment(GLint internalFormat, GLint format, GLsizei width, GLsizei height, GLenum type)<br>Creates a color attachment with index 0.
voidbind() const
voidcreate()
voiddispose()
voidresize(int width, int height)

Public Attributes

Name
GLintm_format <br>Pixel data format (see OpenGL docs)
intm_height <br>Texture height in pixels.
unsigned intm_index <br>Index of the color attachment.
GLintm_internalFormat <br>Pixel data internal format (see OpenGL docs)
GLintm_magFilter
GLintm_minFilter
boolm_multisampled <br>Use MSAA texture.
unsigned intm_samples <br>Number of MSAA samples if multisampled.
boolm_syncSize
GLuintm_texture <br>ID of the created texture.
GLintm_textureWrapS
GLintm_textureWrapT
GLenumm_type <br>Pixel data type (see OpenGL docs)
intm_width <br>Texture width in pixels.

Public Functions Documentation

function ColorAttachment

cpp
ColorAttachment(
    const ColorAttachment & attchmt
)
ColorAttachment(
    const ColorAttachment & attchmt
)

Copy constructor.

function ColorAttachment

cpp
ColorAttachment(
    GLint internalFormat,
    GLint format,
    GLsizei width,
    GLsizei height,
    GLenum type
)
ColorAttachment(
    GLint internalFormat,
    GLint format,
    GLsizei width,
    GLsizei height,
    GLenum type
)

Creates a color attachment with index 0.

Parameters mimic an OpenGL image texture color attachment.

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_format

cpp
GLint m_format;
GLint m_format;

Pixel data format (see OpenGL docs)

variable m_height

cpp
int m_height;
int m_height;

Texture height in pixels.

variable m_index

cpp
unsigned int m_index {0};
unsigned int m_index {0};

Index of the color attachment.

variable m_internalFormat

cpp
GLint m_internalFormat;
GLint m_internalFormat;

Pixel data internal format (see OpenGL docs)

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_syncSize

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

variable m_texture

cpp
GLuint m_texture {0};
GLuint m_texture {0};

ID of the created texture.

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_type

cpp
GLenum m_type;
GLenum m_type;

Pixel data type (see OpenGL docs)

variable m_width

cpp
int m_width;
int m_width;

Texture width in pixels.


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