OGLplus (0.52.0) a C++ wrapper for OpenGL

oglplus::ObjectOps< tag::ExplicitSel, tag::Buffer > Class Template Reference

Class wrapping buffer functions with explicit target selector. More...

#include </home/chochlik/devel/oglplus/include/oglplus/buffer.hpp>

Inheritance diagram for oglplus::ObjectOps< tag::ExplicitSel, tag::Buffer >:
Collaboration diagram for oglplus::ObjectOps< tag::ExplicitSel, tag::Buffer >:

Classes

struct  Property
 Types related to Buffer. More...
 

Public Types

typedef BufferTypedMap< GLubyte > Map
 Mapping of the buffer to the client address space.
 
typedef BufferTarget Target
 Buffer bind targets.
 
typedef BufferIndexedTarget IndexedTarget
 Buffer indexed bind targets.
 

Public Member Functions

void Bind (Target target) const
 Binds this buffer to the specified target. More...
 
void BindBase (IndexedTarget target, GLuint index) const
 Binds this buffer to the specified indexed target. More...
 
void BindBaseUniform (UniformBufferBindingPoint index) const
 Bind this buffer to the specified uniform buffer binding point. More...
 
void BindBaseTransformFeedback (TransformFeedbackBufferBindingPoint index) const
 Bind this buffer to the specified TFB buffer binding point. More...
 
void BindBaseAtomicCounter (AtomicCounterBufferBindingPoint index) const
 Bind this buffer to the specified atomic counter buffer binding point. More...
 
void BindBaseShaderStorage (ShaderStorageBufferBindingPoint index) const
 Bind this buffer to the specified shader storage buffer binding point. More...
 
void BindRange (IndexedTarget target, GLuint index, BufferSize offset, BufferSize size) const
 Binds a range in this buffer to the specified indexed target. More...
 
void InvalidateData (void)
 Invalidate the buffer data. More...
 
void InvalidateSubData (BufferSize offset, BufferSize size)
 Invalidate a subrange of the buffer data. More...
 

Static Public Member Functions

static bool Mapped (Target target)
 Returns true if the buffer is mapped. More...
 
static void Resize (Target target, BufferSize size, BufferUsage usage=BufferUsage::StaticDraw)
 Allocates buffer storage to the specified size without any data. More...
 
static void Data (Target target, const BufferData &data, BufferUsage usage=BufferUsage::StaticDraw)
 Uploads (sets) the buffer data. More...
 
static void RawData (Target target, BufferSize size, const GLvoid *data, BufferUsage usage=BufferUsage::StaticDraw)
 Uploads (sets) the buffer data. More...
 
template<typename GLtype >
static void Data (Target target, GLsizei count, const GLtype *data, BufferUsage usage=BufferUsage::StaticDraw)
 Uploads (sets) the buffer data. More...
 
template<typename GLtype >
static void SubData (Target target, BufferSize offset, GLsizei count, const GLtype *data)
 Uploads (sets) a subrange of the buffer data. More...
 
static void CopySubData (BufferTarget readtarget, BufferTarget writetarget, BufferSize readoffset, BufferSize writeoffset, BufferSize size)
 Copy data between buffers. More...
 
template<typename GLtype >
static void ClearData (Target target, PixelDataInternalFormat internal_format, PixelDataFormat format, const GLtype *data)
 Clear the buffer data. More...
 
template<typename GLtype >
static void ClearSubData (Target target, PixelDataInternalFormat internal_format, BufferSize offset, BufferSize size, PixelDataFormat format, const GLtype *data)
 Clear a subrange of the buffer data. More...
 
static void Storage (Target target, BufferSize size, const void *data, Bitfield< BufferStorageBit > flags)
 Creates a data store for a buffer object. More...
 
static bool ImmutableStorage (Target target)
 Returns true if the buffer storage is immutable. More...
 
static Bitfield< BufferStorageBitStorageFlags (Target target)
 Returns the buffer storage flags. More...
 
static GLsizei Size (Target target)
 Returns the buffer size. More...
 
static BufferUsage Usage (Target target)
 Returns the buffer usage. More...
 
static Bitfield< BufferMapAccessAccess (Target target)
 Returns the buffer usage. More...
 
static void MakeResident (Target target, AccessSpecifier access)
 Makes buffer currently bound to target accessible to GLSL shaders. More...
 
static void MakeNonResident (Target target)
 Makes buffer currently bound to target inaccessible to GLSL shaders. More...
 
static BufferGPUAddress GPUAddress (Target target)
 Returns the GPU address of the buffer currently bound to target. More...
 
static void Bind (Target target, BufferName buffer)
 Binds the specified buffer to the specified target. More...
 
static void BindBase (IndexedTarget target, GLuint index, BufferName buffer)
 Bind the specified buffer to the specified indexed target. More...
 
static void BindBase (BufferIndexedTarget target, GLuint first, const Sequence< BufferName > &buffers)
 Sequentially binds buffers to target starting at first index. More...
 
static void BindRange (IndexedTarget target, GLuint index, BufferName buffer, BufferSize offset, BufferSize size)
 Bind a range the specified buffer to the specified indexed target. More...
 
static BufferName Binding (Target target)
 Returns the current Buffer bound to specified target. More...
 
static BufferName Binding (IndexedTarget target, GLuint idx)
 Returns the current Buffer bound to specified indexed target. More...
 

Detailed Description

template<>
class oglplus::ObjectOps< tag::ExplicitSel, tag::Buffer >

Class wrapping buffer functions with explicit target selector.

Note
Do not use this class directly, use Buffer instead.

Member Function Documentation

static Bitfield<BufferMapAccess> oglplus::ObjectOps< tag::ExplicitSel, tag::Buffer >::Access ( Target  target)
static

Returns the buffer usage.

See Also
Usage
Related OpenGL symbols:
glGetBufferParameter GL_BUFFER_ACCESS
Exceptions
Error
static void oglplus::ObjBindingOps< tag::Buffer >::Bind ( Target  target,
BufferName  buffer 
)
staticinherited

Binds the specified buffer to the specified target.

Related OpenGL symbols:
glBindBuffer

References oglplus::GetGLName().

void oglplus::ObjCommonOps< tag::Buffer >::Bind ( Target  target) const
inherited

Binds this buffer to the specified target.

Related OpenGL symbols:
glBindBuffer
static void oglplus::ObjBindingOps< tag::Buffer >::BindBase ( IndexedTarget  target,
GLuint  index,
BufferName  buffer 
)
staticinherited

Bind the specified buffer to the specified indexed target.

Exceptions
Error

References oglplus::GetGLName().

static void oglplus::ObjBindingOps< tag::Buffer >::BindBase ( BufferIndexedTarget  target,
GLuint  first,
const Sequence< BufferName > &  buffers 
)
staticinherited

Sequentially binds buffers to target starting at first index.

Related OpenGL symbols:
glBindBase Requires OpenGL 4.4 or the GL_ARB_multi_bind extension.

References oglplus::GetGLNames(), and oglplus::Sequence< ObjName >::size().

void oglplus::ObjCommonOps< tag::Buffer >::BindBase ( IndexedTarget  target,
GLuint  index 
) const
inherited

Binds this buffer to the specified indexed target.

Related OpenGL symbols:
glBindBuffer
void oglplus::ObjCommonOps< tag::Buffer >::BindBaseAtomicCounter ( AtomicCounterBufferBindingPoint  index) const
inherited

Bind this buffer to the specified atomic counter buffer binding point.

Exceptions
ErrorRequires OpenGL 4.2 or the GL_ARB_shader_atomic_counters extension.

References oglplus::AtomicCounter.

void oglplus::ObjCommonOps< tag::Buffer >::BindBaseShaderStorage ( ShaderStorageBufferBindingPoint  index) const
inherited

Bind this buffer to the specified shader storage buffer binding point.

Exceptions
ErrorRequires OpenGL 4.3 or the GL_ARB_shader_storage_buffer_object extension.

References oglplus::ShaderStorage.

void oglplus::ObjCommonOps< tag::Buffer >::BindBaseTransformFeedback ( TransformFeedbackBufferBindingPoint  index) const
inherited

Bind this buffer to the specified TFB buffer binding point.

Exceptions
ErrorRequires OpenGL 4.0 or the GL_ARB_transform_feedback3 extension.

References oglplus::TransformFeedback.

void oglplus::ObjCommonOps< tag::Buffer >::BindBaseUniform ( UniformBufferBindingPoint  index) const
inherited

Bind this buffer to the specified uniform buffer binding point.

Exceptions
ErrorRequires OpenGL 4.0 or the GL_ARB_transform_feedback3 extension.

References oglplus::Uniform.

static BufferName oglplus::ObjBindingOps< tag::Buffer >::Binding ( Target  target)
staticinherited

Returns the current Buffer bound to specified target.

Related OpenGL symbols:
glGetIntegerv
static BufferName oglplus::ObjBindingOps< tag::Buffer >::Binding ( IndexedTarget  target,
GLuint  idx 
)
staticinherited

Returns the current Buffer bound to specified indexed target.

Related OpenGL symbols:
glGetIntegerv
static void oglplus::ObjBindingOps< tag::Buffer >::BindRange ( IndexedTarget  target,
GLuint  index,
BufferName  buffer,
BufferSize  offset,
BufferSize  size 
)
staticinherited

Bind a range the specified buffer to the specified indexed target.

Exceptions
Error

References oglplus::BufferSize::Get(), and oglplus::GetGLName().

void oglplus::ObjCommonOps< tag::Buffer >::BindRange ( IndexedTarget  target,
GLuint  index,
BufferSize  offset,
BufferSize  size 
) const
inherited

Binds a range in this buffer to the specified indexed target.

Related OpenGL symbols:
glBindBufferRange
template<typename GLtype >
static void oglplus::ObjectOps< tag::ExplicitSel, tag::Buffer >::ClearData ( Target  target,
PixelDataInternalFormat  internal_format,
PixelDataFormat  format,
const GLtype *  data 
)
static

Clear the buffer data.

See Also
Data
ClearSubData
SubData
CopySubData
Exceptions
ErrorRequires OpenGL 4.3.
template<typename GLtype >
static void oglplus::ObjectOps< tag::ExplicitSel, tag::Buffer >::ClearSubData ( Target  target,
PixelDataInternalFormat  internal_format,
BufferSize  offset,
BufferSize  size,
PixelDataFormat  format,
const GLtype *  data 
)
static

Clear a subrange of the buffer data.

See Also
Data
ClearData
SubData
CopySubData
Exceptions
ErrorRequires OpenGL 4.3.

References oglplus::BufferSize::Get().

static void oglplus::ObjectOps< tag::ExplicitSel, tag::Buffer >::CopySubData ( BufferTarget  readtarget,
BufferTarget  writetarget,
BufferSize  readoffset,
BufferSize  writeoffset,
BufferSize  size 
)
static

Copy data between buffers.

See Also
Data
SubData
Exceptions
ErrorRequires OpenGL 3.1 or the GL_ARB_copy_buffer extension.

References oglplus::BufferSize::Get().

static void oglplus::ObjectOps< tag::ExplicitSel, tag::Buffer >::Data ( Target  target,
const BufferData data,
BufferUsage  usage = BufferUsage::StaticDraw 
)
static

Uploads (sets) the buffer data.

This member function uploads the specified to the buffer bound to the specified target using the usage as hint.

See Also
SubData
CopySubData
Exceptions
Error
template<typename GLtype >
static void oglplus::ObjectOps< tag::ExplicitSel, tag::Buffer >::Data ( Target  target,
GLsizei  count,
const GLtype *  data,
BufferUsage  usage = BufferUsage::StaticDraw 
)
static

Uploads (sets) the buffer data.

This member function uploads count units of sizeof(GLtype) from the location pointed to by data to the buffer bound to the specified target using the usage as hint.

See Also
SubData
CopySubData
Exceptions
Error
static BufferGPUAddress oglplus::ObjectOps< tag::ExplicitSel, tag::Buffer >::GPUAddress ( Target  target)
static

Returns the GPU address of the buffer currently bound to target.

Requires the GL_NV_shader_buffer_load extension.

Related OpenGL symbols:
glGetBufferParameterui64vNV GL_BUFFER_GPU_ADDRESS_NV
Exceptions
Error
static bool oglplus::ObjectOps< tag::ExplicitSel, tag::Buffer >::ImmutableStorage ( Target  target)
static

Returns true if the buffer storage is immutable.

Exceptions
ErrorRequires OpenGL 4.4 or the GL_ARB_buffer_storage extension.
Related OpenGL symbols:
glGetBufferParameter GL_BUFFER_IMMUTABLE_STORAGE
void oglplus::ObjCommonOps< tag::Buffer >::InvalidateData ( void  )
inherited

Invalidate the buffer data.

See Also
Data
ClearData
Exceptions
ErrorRequires OpenGL 4.3 or the GL_ARB_invalidate_subdata extension.
void oglplus::ObjCommonOps< tag::Buffer >::InvalidateSubData ( BufferSize  offset,
BufferSize  size 
)
inherited

Invalidate a subrange of the buffer data.

See Also
Data
SubData
InvalidateData
Exceptions
ErrorRequires OpenGL 4.3 or the GL_ARB_invalidate_subdata extension.

References oglplus::BufferSize::Get().

static void oglplus::ObjectOps< tag::ExplicitSel, tag::Buffer >::MakeNonResident ( Target  target)
static

Makes buffer currently bound to target inaccessible to GLSL shaders.

Requires the GL_NV_shader_buffer_load extension.

Related OpenGL symbols:
glMakeBufferNonResidentNV
Exceptions
Error
static void oglplus::ObjectOps< tag::ExplicitSel, tag::Buffer >::MakeResident ( Target  target,
AccessSpecifier  access 
)
static

Makes buffer currently bound to target accessible to GLSL shaders.

Requires the GL_NV_shader_buffer_load extension.

Related OpenGL symbols:
glMakeBufferResidentNV
Exceptions
Error
static bool oglplus::ObjectOps< tag::ExplicitSel, tag::Buffer >::Mapped ( Target  target)
static

Returns true if the buffer is mapped.

Related OpenGL symbols:
glGetBufferParameter GL_BUFFER_MAPPED
Exceptions
Error
static void oglplus::ObjectOps< tag::ExplicitSel, tag::Buffer >::RawData ( Target  target,
BufferSize  size,
const GLvoid *  data,
BufferUsage  usage = BufferUsage::StaticDraw 
)
static

Uploads (sets) the buffer data.

This member function uploads size bytes from the location pointed to by data to the buffer bound to the specified target using the usage as hint.

See Also
SubData
CopySubData
Exceptions
Error
static void oglplus::ObjectOps< tag::ExplicitSel, tag::Buffer >::Resize ( Target  target,
BufferSize  size,
BufferUsage  usage = BufferUsage::StaticDraw 
)
static

Allocates buffer storage to the specified size without any data.

This member function allows to (re-)allocate the buffer storage to the specifies size, without uploading any data.

Related OpenGL symbols:
glBufferData
See Also
SubData
Exceptions
Error

References oglplus::BufferSize::Get().

static GLsizei oglplus::ObjectOps< tag::ExplicitSel, tag::Buffer >::Size ( Target  target)
static

Returns the buffer size.

Related OpenGL symbols:
glGetBufferParameter GL_BUFFER_SIZE
Exceptions
Error
static void oglplus::ObjectOps< tag::ExplicitSel, tag::Buffer >::Storage ( Target  target,
BufferSize  size,
const void *  data,
Bitfield< BufferStorageBit flags 
)
static

Creates a data store for a buffer object.

See Also
Data
SubData
CopySubData
Exceptions
ErrorRequires OpenGL 4.4 or the GL_ARB_buffer_storage extension.
Related OpenGL symbols:
glBufferStorage
static Bitfield<BufferStorageBit> oglplus::ObjectOps< tag::ExplicitSel, tag::Buffer >::StorageFlags ( Target  target)
static

Returns the buffer storage flags.

Exceptions
ErrorRequires OpenGL 4.4 or the GL_ARB_buffer_storage extension.
Related OpenGL symbols:
glGetBufferParameter GL_BUFFER_STORAGE_FLAGS
template<typename GLtype >
static void oglplus::ObjectOps< tag::ExplicitSel, tag::Buffer >::SubData ( Target  target,
BufferSize  offset,
GLsizei  count,
const GLtype *  data 
)
static

Uploads (sets) a subrange of the buffer data.

See Also
Data
CopySubData
Exceptions
Error
static BufferUsage oglplus::ObjectOps< tag::ExplicitSel, tag::Buffer >::Usage ( Target  target)
static

Returns the buffer usage.

See Also
Access
Related OpenGL symbols:
glGetBufferParameter GL_BUFFER_USAGE
Exceptions
Error

The documentation for this class was generated from the following file:
  • /home/chochlik/devel/oglplus/include/oglplus/buffer.hpp

Copyright © 2010-2014 Matúš Chochlík, University of Žilina, Žilina, Slovakia.
<matus.chochlik -at- fri.uniza.sk>
<chochlik -at -gmail.com>
Documentation generated on Mon Sep 22 2014 by Doxygen (version 1.8.6).