Brenta Engine 1.2
Loading...
Searching...
No Matches
brenta::types::framebuffer Class Reference

FrameBuffer class. More...

#include <frame_buffer.hpp>

Inheritance diagram for brenta::types::framebuffer:
brenta::types::buffer

Public Member Functions

 framebuffer ()
 Empty constructor Does nothing.
 
 framebuffer (int width, int height, GLenum format=GL_RGBA)
 Constructor Creates a framebuffer with a texture and a render buffer.
 
 ~framebuffer ()
 Destructor Deletes the framebuffer and its texture.
 
void bind ()
 
void unbind ()
 
void destroy ()
 Delete the framebuffer and its texture.
 
void copy_data (GLsizeiptr size, const void *data, GLenum usage)
 
void copy_vertices (GLsizeiptr size, const void *data, GLenum usage)
 
void copy_indices (GLsizeiptr size, const void *data, GLenum usage)
 
void rescale (int width, int height)
 Rescale the framebuffer.
 
void set_format (GLenum format)
 Set the format of the framebuffer.
 
- Public Member Functions inherited from brenta::types::buffer
 buffer ()
 Default constructor, does nothing.
 
 buffer (GLenum input_target)
 Constructor that creates a buffer object.
 
void bind ()
 Bind the buffer object.
 
void unbind ()
 Unbind the buffer object.
 
void destroy ()
 Delete the buffer object.
 
int get_id ()
 Get the buffer object id.
 
GLenum get_target ()
 Get the buffer object target.
 
void set_id (unsigned int id)
 Set the buffer object id.
 
void set_target (GLenum target)
 Set the buffer object target.
 
void copy_data (GLsizeiptr size, const void *data, GLenum usage)
 Copy data to the buffer object.
 
void copy_vertices (GLsizeiptr size, const void *data, GLenum usage)
 Copy data to the buffer object.
 
void copy_indices (GLsizeiptr size, const void *data, GLenum usage)
 Copy data to the buffer object.
 

Data Fields

GLuint texture_id
 
GLuint render_buffer_id
 
GLenum format
 Color format of the frame buffer Default is GL_RGBA.
 
- Data Fields inherited from brenta::types::buffer
unsigned int id
 Buffer object id, generated by OpenGL.
 
GLenum target
 Buffer object target (like GL_ARRAY_BUFFER, GL_ELEMENT_ARRAY_BUFFER...)
 

Detailed Description

FrameBuffer class.

This class is a wrapper around OpenGL frame buffers, providing functions to create, bind, unbind, delete and rescale the frame buffer.

Definition at line 24 of file frame_buffer.hpp.

Constructor & Destructor Documentation

◆ framebuffer() [1/2]

brenta::types::framebuffer::framebuffer ( )
inline

Empty constructor Does nothing.

Definition at line 38 of file frame_buffer.hpp.

◆ framebuffer() [2/2]

framebuffer::framebuffer ( int width,
int height,
GLenum format = GL_RGBA )

Constructor Creates a framebuffer with a texture and a render buffer.

Parameters
widthWidth of the framebuffer
heightHeight of the framebuffer

Definition at line 16 of file frame_buffer.cpp.

◆ ~framebuffer()

framebuffer::~framebuffer ( )

Destructor Deletes the framebuffer and its texture.

Definition at line 63 of file frame_buffer.cpp.

Member Function Documentation

◆ bind()

void framebuffer::bind ( )

Definition at line 69 of file frame_buffer.cpp.

◆ copy_data()

void brenta::types::framebuffer::copy_data ( GLsizeiptr size,
const void * data,
GLenum usage )
inline

Definition at line 60 of file frame_buffer.hpp.

◆ copy_indices()

void brenta::types::framebuffer::copy_indices ( GLsizeiptr size,
const void * data,
GLenum usage )
inline

Definition at line 73 of file frame_buffer.hpp.

◆ copy_vertices()

void brenta::types::framebuffer::copy_vertices ( GLsizeiptr size,
const void * data,
GLenum usage )
inline

Definition at line 67 of file frame_buffer.hpp.

◆ destroy()

void framebuffer::destroy ( )

Delete the framebuffer and its texture.

Definition at line 81 of file frame_buffer.cpp.

◆ rescale()

void framebuffer::rescale ( int width,
int height )

Rescale the framebuffer.

Parameters
widthNew width of the framebuffer
heightNew height of the framebuffer

Definition at line 87 of file frame_buffer.cpp.

◆ set_format()

void framebuffer::set_format ( GLenum format)

Set the format of the framebuffer.

Parameters
formatNew format of the framebuffer

Definition at line 116 of file frame_buffer.cpp.

◆ unbind()

void framebuffer::unbind ( )

Definition at line 75 of file frame_buffer.cpp.

Field Documentation

◆ format

GLenum brenta::types::framebuffer::format

Color format of the frame buffer Default is GL_RGBA.

Definition at line 33 of file frame_buffer.hpp.

◆ render_buffer_id

GLuint brenta::types::framebuffer::render_buffer_id

Definition at line 28 of file frame_buffer.hpp.

◆ texture_id

GLuint brenta::types::framebuffer::texture_id

Definition at line 27 of file frame_buffer.hpp.


The documentation for this class was generated from the following files: