Brenta Engine 1.2
Loading...
Searching...
No Matches
brenta::Buffer Class Reference
Inheritance diagram for brenta::Buffer:
brenta::FrameBuffer brenta::Ubo

Public Types

enum  Target {
  Array = GL_ARRAY_BUFFER , ElementArray = GL_ELEMENT_ARRAY_BUFFER , Uniform = GL_UNIFORM_BUFFER , Texture = GL_TEXTURE_BUFFER ,
  TransformFeedback = GL_TRANSFORM_FEEDBACK_BUFFER , CopyRead = GL_COPY_READ_BUFFER , PixelUnpack = GL_PIXEL_UNPACK_BUFFER , ShaderStorage = GL_SHADER_STORAGE_BUFFER
}
 
enum  DataUsage {
  StreamDraw = GL_STREAM_DRAW , StreamRead = GL_STREAM_READ , StreamCopy = GL_STREAM_COPY , StaticDraw = GL_STATIC_DRAW ,
  StaticRead = GL_STATIC_READ , StaticCopy = GL_STATIC_COPY , DynamicDraw = GL_DYNAMIC_DRAW , DynamicRead = GL_DYNAMIC_READ ,
  DynamicCopy = GL_DYNAMIC_COPY
}
 
using Id = unsigned int
 

Public Member Functions

 Buffer (Target target)
 
constexpr Buffer (const Buffer &)=delete
 
constexpr Bufferoperator= (const Buffer &)=delete
 
constexpr Buffer (Buffer &&other) noexcept
 
constexpr Bufferoperator= (Buffer &&other) noexcept
 
void init (Target target)
 
void destroy ()
 
virtual void bind () const
 
virtual void unbind () const
 
Buffer::Id get_id () const
 
Target & get_target ()
 
void set_id (Buffer::Id id)
 
void set_target (Target target)
 
void copy_data (const void *data, GLsizeiptr size, DataUsage usage)
 

Data Fields

int memory = 0
 

Static Public Attributes

static int tot_memory = 0
 

Protected Attributes

Buffer::Id id = 0
 
Target target
 

Detailed Description

Definition at line 13 of file buffer.hpp.

Member Typedef Documentation

◆ Id

using brenta::Buffer::Id = unsigned int

Definition at line 17 of file buffer.hpp.

Member Enumeration Documentation

◆ DataUsage

enum brenta::Buffer::DataUsage

Definition at line 38 of file buffer.hpp.

◆ Target

enum brenta::Buffer::Target

Definition at line 19 of file buffer.hpp.

Constructor & Destructor Documentation

◆ Buffer() [1/2]

Buffer::Buffer ( Buffer::Target  target)

Definition at line 13 of file buffer.cpp.

◆ Buffer() [2/2]

constexpr brenta::Buffer::Buffer ( Buffer &&  other)
inlineconstexprnoexcept

Definition at line 64 of file buffer.hpp.

◆ ~Buffer()

Buffer::~Buffer ( )
virtual

Definition at line 19 of file buffer.cpp.

Member Function Documentation

◆ bind()

void Buffer::bind ( ) const
virtual

Definition at line 49 of file buffer.cpp.

◆ copy_data()

void Buffer::copy_data ( const void *  data,
GLsizeiptr  size,
Buffer::DataUsage  usage 
)

Definition at line 86 of file buffer.cpp.

◆ destroy()

void Buffer::destroy ( )

Definition at line 34 of file buffer.cpp.

◆ get_id()

Buffer::Id Buffer::get_id ( ) const

Definition at line 66 of file buffer.cpp.

◆ get_target()

Buffer::Target & Buffer::get_target ( )

Definition at line 71 of file buffer.cpp.

◆ init()

void Buffer::init ( Buffer::Target  target)

Definition at line 25 of file buffer.cpp.

◆ operator=()

constexpr Buffer & brenta::Buffer::operator= ( Buffer &&  other)
inlineconstexprnoexcept

Definition at line 73 of file buffer.hpp.

◆ set_id()

void Buffer::set_id ( Buffer::Id  id)

Definition at line 76 of file buffer.cpp.

◆ set_target()

void Buffer::set_target ( Buffer::Target  target)

Definition at line 81 of file buffer.cpp.

◆ unbind()

void Buffer::unbind ( ) const
virtual

Definition at line 60 of file buffer.cpp.

Field Documentation

◆ id

Buffer::Id brenta::Buffer::id = 0
protected

Definition at line 108 of file buffer.hpp.

◆ memory

int brenta::Buffer::memory = 0

Definition at line 55 of file buffer.hpp.

◆ target

Target brenta::Buffer::target
protected

Definition at line 109 of file buffer.hpp.

◆ tot_memory

int Buffer::tot_memory = 0
static

Definition at line 56 of file buffer.hpp.


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