SenOGL  0.2
Library aiming to ease the use of OpenGL
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
IndexedBuffer Class Reference

Specialization for buffers that can be bound (i.e. More...

#include <Buffer.hpp>

Inheritance diagram for IndexedBuffer:
Buffer OpenGLObject UniformBuffer

Public Member Functions

 IndexedBuffer (Target type)
 
void bind (GLuint bindingPoint)
 Bind this buffer to the specified binding point in the OpenGL context. More...
 
bool isBound () const
 
GLuint getBindingPoint () const
 
- Public Member Functions inherited from Buffer
 Buffer ()=default
 Default Constructor Avoid using this is favor of the 'typed' constructor when possible. More...
 
 Buffer (Target type, GLuint handle=0)
 Constructor specifying a buffer type. More...
 
 Buffer (const Buffer &)=default
 Copy constructor. More...
 
 Buffer (Buffer &&)=default
 Move constructor. More...
 
Bufferoperator= (const Buffer &)=default
 Assigment operator. More...
 
Bufferoperator= (Buffer &&)=default
 Move assignment operator. More...
 
virtual ~Buffer ()
 Destructor. More...
 
virtual void init () override
 Generates a new buffer name to manage. More...
 
void init (Target t)
 Generates a new buffer of type t. More...
 
virtual void cleanup () override
 Destroy managed buffer. More...
 
void bind () const
 Binds the buffer to its assigned target (type) More...
 
void bind (Target t) const
 Binds the buffer to arbitrary target (type) More...
 
void bind (GLuint bindingPoint, GLintptr offset=0, GLsizeiptr size=0) const
 Bind this buffer to the specified binding point in the OpenGL context. More...
 
void bind (Target target, GLuint bindingPoint, GLintptr offset=0, GLsizeiptr size=0) const
 Similar to bind(GLuint, GLintptr, GLsizeiptr) but allowing for another target than the type of the buffer. More...
 
void unbind () const
 Unbinds the buffer. More...
 
void data (const void *data, size_t size, Buffer::Usage usage) const
 glBufferData More...
 
void store (const void *data, size_t size, Buffer::StorageUsage flags) const
 glBufferStorage More...
 
void subData (size_t offset, size_t size, const void *data) const
 glBufferSubData​ More...
 
Target getType () const
 
void setType (Target t)
 If the type wasn't specified at creation, this should be called before any init() More...
 
- Public Member Functions inherited from OpenGLObject
 OpenGLObject ()
 
 OpenGLObject (GLuint handle)
 Constructs a instance managing an existing OpenGL Object. More...
 
 OpenGLObject (const OpenGLObject &)=default
 
 OpenGLObject (OpenGLObject &&)=default
 
OpenGLObjectoperator= (const OpenGLObject &)=default
 
OpenGLObjectoperator= (OpenGLObject &&)=default
 
virtual ~OpenGLObject ()
 
GLuint getName () const
 Returns OpenGL name of the object. More...
 
void setName (GLuint n)
 Sets the OpenGL name of the object managed by this instance /!\ Use with caution ! (assignment operator is probably what you're looking for) More...
 
virtual bool isValid () const
 Returns true if the object seems valid. More...
 
 operator bool () const
 Syntactic sugar for isValid(). More...
 

Additional Inherited Members

- Public Types inherited from Buffer
enum  Target : GLenum {
  Target::VertexAttributes = GL_ARRAY_BUFFER, Target::AtomicCounter = GL_ATOMIC_COUNTER_BUFFER, Target::CopyRead = GL_COPY_READ_BUFFER, Target::CopyWrite = GL_COPY_WRITE_BUFFER,
  Target::IndirectDispatch = GL_DISPATCH_INDIRECT_BUFFER, Target::IndirectDraw = GL_DRAW_INDIRECT_BUFFER, Target::VertexIndices = GL_ELEMENT_ARRAY_BUFFER, Target::PixelPack = GL_PIXEL_PACK_BUFFER,
  Target::PixelUnpack = GL_PIXEL_UNPACK_BUFFER, Target::Query = GL_QUERY_BUFFER, Target::ShaderStorage = GL_SHADER_STORAGE_BUFFER, Target::Texture = GL_TEXTURE_BUFFER,
  Target::TransformFeedback = GL_TRANSFORM_FEEDBACK_BUFFER, Target::Uniform = GL_UNIFORM_BUFFER
}
 Bind targets. More...
 
enum  Usage : GLenum {
  Usage::StaticDraw = GL_STATIC_DRAW, Usage::StaticRead = GL_STATIC_READ, Usage::StaticCopy = GL_STATIC_COPY, Usage::DynamicDraw = GL_DYNAMIC_DRAW,
  Usage::DynamicRead = GL_DYNAMIC_READ, Usage::DynamicCopy = GL_DYNAMIC_COPY, Usage::StreamDraw = GL_STREAM_DRAW, Usage::StreamRead = GL_STREAM_READ,
  Usage::StreamCopy = GL_STREAM_COPY
}
 Usage hint for mutable buffers. More...
 
enum  StorageUsage : GLbitfield {
  StorageUsage::Unspecified = 0, StorageUsage::DynamicStorageBit = GL_DYNAMIC_STORAGE_BIT, StorageUsage::MapReadBit = GL_MAP_READ_BIT, StorageUsage::MapWriteBit = GL_MAP_WRITE_BIT,
  StorageUsage::MapPersistentBit = GL_MAP_PERSISTENT_BIT, StorageUsage::MapCoherentBit = GL_MAP_COHERENT_BIT, StorageUsage::ClientStorageBit = GL_CLIENT_STORAGE_BIT
}
 Usage hint for immutable buffers. More...
 
- Static Public Member Functions inherited from Buffer
static void copySubData (Target srcType, Target dstType, GLuint srcOffset, GLuint dstOffset, GLuint size)
 glCopyBufferSubData More...
 
static void copySubData (const Buffer &src, const Buffer &dst, GLuint srcOffset, GLuint dstOffset, GLuint size)
 glCopyNamedBufferSubData More...
 
- Protected Attributes inherited from Buffer
Target _type = Target::VertexAttributes
 Target of the Buffer. More...
 
- Protected Attributes inherited from OpenGLObject
GLuint _handle
 OpenGL name of the managed object. More...
 

Detailed Description

Specialization for buffers that can be bound (i.e.

AtomicCounter, TransformFeedback, Uniform or ShaderStorage).

See also
bind(GLuint bindingPoint)
isBound()
getBindingPoint()

Constructor & Destructor Documentation

IndexedBuffer::IndexedBuffer ( Target  type)

Member Function Documentation

void IndexedBuffer::bind ( GLuint  bindingPoint)

Bind this buffer to the specified binding point in the OpenGL context.

Buffer type must be AtomicCounter, TransformFeedback, Uniform or ShaderStorage.

Parameters
bindingPointBinding Point
See also
glBindBufferBase
getBindingPoint()
isBound()
GLuint IndexedBuffer::getBindingPoint ( ) const
inline
Returns
Binding point which the buffer is currently bound to (result is undefined if isBound() returns false).
See also
isBound()
bool IndexedBuffer::isBound ( ) const
inline
Returns
True if this buffer is bound to a binding point (by a call to bindBase)
See also
bindBase()

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