OGLplus (0.30.0) a C++ wrapper for OpenGL

An OGLplus object encapsulating the OpenGL buffer functionality. More...

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

Inheritance diagram for oglplus::Buffer:
Collaboration diagram for oglplus::Buffer:

List of all members.

Public Types

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

Public Member Functions

void Bind (Target target) const
 Bind this buffer to the specified target.
void BindBase (IndexedTarget target, GLuint index) const
 Bind this buffer to the specified indexed target.
void BindBaseUniform (UniformBufferBindingPoint index) const
 Bind this buffer to the specified uniform buffer binding point.
void BindBaseTransformFeedback (TransformFeedbackBufferBindingPoint index) const
 Bind this buffer to the specified TFB buffer binding point.
void BindBaseAtomicCounter (AtomicCounterBufferBindingPoint index) const
 Bind this buffer to the specified atomic counter buffer binding point.
void BindBaseShaderStorage (ShaderStorageBufferBindingPoint index) const
 Bind this buffer to the specified shader storage buffer binding point.
void BindRange (IndexedTarget target, GLuint index, GLintptr offset, GLsizeiptr size) const
 Bind a range in this buffer to the specified indexed target.

Static Public Member Functions

static bool Mapped (Target target)
 Returns true if the buffer is mapped.
static void Unbind (Target target)
 Unbind the current buffer from the specified target.
static void UnbindBase (IndexedTarget target, GLuint index)
 Unbind the current buffer from the specified indexed target.
template<typename GLtype >
static void Data (Target target, GLsizei count, GLtype *data, BufferUsage usage=BufferUsage::StaticDraw)
 Uploads (sets) the buffer data.
template<typename GLtype >
static void Data (Target target, const std::vector< GLtype > &data, BufferUsage usage=BufferUsage::StaticDraw)
 Uploads (sets) the buffer data.
template<typename GLtype , std::size_t N>
static void Data (Target target, const std::vector< Vector< GLtype, N > > &data, BufferUsage usage=BufferUsage::StaticDraw)
 Uploads (sets) the buffer data.
template<typename GLtype >
static void SubData (Target target, GLintptr offset, GLsizei count, GLtype *data)
 Uploads (sets) a subrange of the buffer data.
template<typename GLtype >
static void SubData (Target target, GLintptr offset, const std::vector< GLtype > &data)
 Uploads (sets) a subrange of the buffer data.
static void CopySubData (BufferOps::Target readtarget, BufferOps::Target writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size)
 Copy data between buffers.
template<typename GLtype >
static void ClearData (Target target, PixelDataInternalFormat internal_format, PixelDataFormat format, const std::vector< GLtype > &data)
 Clear the buffer data.
template<typename GLtype >
static void ClearSubData (Target target, PixelDataInternalFormat internal_format, GLintptr offset, GLsizeiptr size, PixelDataFormat format, const std::vector< GLtype > &data)
 Clear a subrange of the buffer data.
static GLsizei Size (Target target)
 Returns the buffer size.
static BufferUsage Usage (Target target)
 Returns the buffer usage.
static BufferMapAccess Access (Target target)
 Returns the buffer usage.

Detailed Description


Member Function Documentation

static BufferMapAccess oglplus::BufferOps::Access ( Target  target) [static, inherited]

Returns the buffer usage.

See also:
Usage
Related OpenGL symbols:
glGetBufferParameter GL_BUFFER_ACCESS
Exceptions:
Error
void oglplus::BufferOps::Bind ( Target  target) const [inherited]

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

Exceptions:
Error

References oglplus::AtomicCounter, and oglplus::BufferOps::BindBase().

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

Exceptions:
Error

References oglplus::BufferOps::BindBase(), and oglplus::ShaderStorage.

Bind this buffer to the specified TFB buffer binding point.

Exceptions:
Error

References oglplus::BufferOps::BindBase(), and oglplus::TransformFeedback.

Bind this buffer to the specified uniform buffer binding point.

Exceptions:
Error

References oglplus::BufferOps::BindBase(), and oglplus::Uniform.

void oglplus::BufferOps::BindRange ( IndexedTarget  target,
GLuint  index,
GLintptr  offset,
GLsizeiptr  size 
) const [inherited]

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

Exceptions:
Error

References oglplus::EnumValueName(), and OGLPLUS_VERIFY.

template<typename GLtype >
static void oglplus::BufferOps::ClearData ( Target  target,
PixelDataInternalFormat  internal_format,
PixelDataFormat  format,
const std::vector< GLtype > &  data 
) [static, inherited]

Clear the buffer data.

See also:
Data
ClearSubData
SubData
CopySubData
Exceptions:
ErrorRequires OpenGL 4.3.

References oglplus::EnumValueName(), and OGLPLUS_CHECK.

Referenced by oglplus::BoundTemplate< Base, BaseParam, BufferOps >::ClearData().

template<typename GLtype >
static void oglplus::BufferOps::ClearSubData ( Target  target,
PixelDataInternalFormat  internal_format,
GLintptr  offset,
GLsizeiptr  size,
PixelDataFormat  format,
const std::vector< GLtype > &  data 
) [static, inherited]

Clear a subrange of the buffer data.

See also:
Data
ClearData
SubData
CopySubData
Exceptions:
ErrorRequires OpenGL 4.3.

References oglplus::EnumValueName(), and OGLPLUS_CHECK.

Referenced by oglplus::BoundTemplate< Base, BaseParam, BufferOps >::ClearSubData().

static void oglplus::BufferOps::CopySubData ( BufferOps::Target  readtarget,
BufferOps::Target  writetarget,
GLintptr  readoffset,
GLintptr  writeoffset,
GLsizeiptr  size 
) [static, inherited]

Copy data between buffers.

See also:
Data
SubData
Exceptions:
ErrorRequires OpenGL 3.1 or the GL_ARB_copy_buffer extension.
Examples:
oglplus/031_neon.cpp, and oglplus/040_jelly_cube.cpp.

References OGLPLUS_CHECK.

template<typename GLtype >
static void oglplus::BufferOps::Data ( Target  target,
GLsizei  count,
GLtype *  data,
BufferUsage  usage = BufferUsage::StaticDraw 
) [static, inherited]

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
Examples:
oglplus/001_triangle.cpp, oglplus/001_triangle_glsl120.cpp, oglplus/002_rect.cpp, oglplus/002_shader_lit.cpp, oglplus/002_triangle.cpp, oglplus/003_rect.cpp, oglplus/003_triangle.cpp, oglplus/004_newton.cpp, oglplus/004_rect.cpp, oglplus/005_mandelbrot.cpp, oglplus/006_cartoon_sun.cpp, oglplus/006_newton_zoom.cpp, oglplus/008_lyapunov.cpp, oglplus/009_metaballs.cpp, oglplus/010_cmy_cube_glsl120.cpp, oglplus/010_rgb_cube.cpp, oglplus/012_checker_cube.cpp, oglplus/012_checker_sphere.cpp, oglplus/013_spiral_sphere.cpp, oglplus/013_striped_cubes.cpp, oglplus/014_multi_cube.cpp, oglplus/014_multi_cube_gs.cpp, oglplus/014_multi_cube_ub.cpp, oglplus/015_graph.cpp, oglplus/015_obj_mesh.cpp, oglplus/015_shaded_cube.cpp, oglplus/016_cartoon_torus.cpp, oglplus/016_metallic_torus.cpp, oglplus/016_noise_torus.cpp, oglplus/016_textured_cube.cpp, oglplus/016_textured_cube_glsl120.cpp, oglplus/017_clipped_torus.cpp, oglplus/017_phong_torus.cpp, oglplus/017_single_pass_edges.cpp, oglplus/017_sky_box.cpp, oglplus/018_atomic_counters.cpp, oglplus/018_newton_landscape.cpp, oglplus/018_particle_system.cpp, oglplus/018_stained_glass_cube.cpp, oglplus/019_bpatch_tess.cpp, oglplus/019_gs_tessell.cpp, oglplus/019_helium.cpp, oglplus/019_honeycomb_cube.cpp, oglplus/019_subsurf_scatter.cpp, oglplus/019_tessellation.cpp, oglplus/020_checkered_objects.cpp, oglplus/020_golf_ball.cpp, oglplus/020_shaded_objects.cpp, oglplus/020_texture_projection.cpp, oglplus/021_cloud.cpp, oglplus/021_cube_mapping.cpp, oglplus/021_morphing.cpp, oglplus/021_wooden_crate.cpp, oglplus/022_parallax_map.cpp, oglplus/022_volumetric_light.cpp, oglplus/022_xyz_planes.cpp, oglplus/023_lattice_torus.cpp, oglplus/023_reflected_cube.cpp, oglplus/023_waves.cpp, oglplus/024_extruded_torus.cpp, oglplus/024_particle_trails.cpp, oglplus/024_simple_picking.cpp, oglplus/025_multi_viewport.cpp, oglplus/025_recursive_texture.cpp, oglplus/025_reflected_torus.cpp, oglplus/025_rendered_texture.cpp, oglplus/026_clouds.cpp, oglplus/026_furry_torus.cpp, oglplus/026_shape_halo.cpp, oglplus/026_stencil_shadow.cpp, oglplus/027_depth_of_field.cpp, oglplus/027_reflected_shape.cpp, oglplus/027_smoke_trails.cpp, oglplus/027_tessellation.cpp, oglplus/028_glass_shape.cpp, oglplus/028_ripples.cpp, oglplus/028_volume.cpp, oglplus/029_flares.cpp, oglplus/029_shadow_mapping.cpp, oglplus/029_surface.cpp, oglplus/029_waves.cpp, oglplus/030_cube_mapping.cpp, oglplus/030_pool_tiles.cpp, oglplus/030_rain.cpp, oglplus/030_shadow_volume.cpp, oglplus/031_blob.cpp, oglplus/031_neon.cpp, oglplus/031_sketch.cpp, oglplus/032_bar_grid.cpp, oglplus/032_transitions.cpp, oglplus/033_metal_and_glass.cpp, oglplus/034_billiard_balls.cpp, oglplus/040_jelly_cube.cpp, oglplus/041_blob_mt.cpp, and standalone/007_glm_boxes.cpp.

References oglplus::EnumValueName(), and OGLPLUS_CHECK.

Referenced by oglplus::BoundTemplate< Base, BaseParam, BufferOps >::Data().

template<typename GLtype >
static void oglplus::BufferOps::Data ( Target  target,
const std::vector< GLtype > &  data,
BufferUsage  usage = BufferUsage::StaticDraw 
) [static, inherited]

Uploads (sets) the buffer data.

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

See also:
SubData
CopySubData
Exceptions:
Error

References oglplus::EnumValueName(), and OGLPLUS_CHECK.

template<typename GLtype , std::size_t N>
static void oglplus::BufferOps::Data ( Target  target,
const std::vector< Vector< GLtype, N > > &  data,
BufferUsage  usage = BufferUsage::StaticDraw 
) [static, inherited]

Uploads (sets) the buffer data.

See also:
SubData
CopySubData
Exceptions:
Error

References oglplus::EnumValueName(), and OGLPLUS_CHECK.

static bool oglplus::BufferOps::Mapped ( Target  target) [static, inherited]

Returns true if the buffer is mapped.

Related OpenGL symbols:
glGetBufferParameter GL_BUFFER_MAPPED
Exceptions:
Error

Referenced by oglplus::BoundTemplate< Base, BaseParam, BufferOps >::Mapped().

static GLsizei oglplus::BufferOps::Size ( Target  target) [static, inherited]

Returns the buffer size.

Related OpenGL symbols:
glGetBufferParameter GL_BUFFER_SIZE
Exceptions:
Error

Referenced by oglplus::BoundTemplate< Base, BaseParam, BufferOps >::Size().

template<typename GLtype >
static void oglplus::BufferOps::SubData ( Target  target,
GLintptr  offset,
GLsizei  count,
GLtype *  data 
) [static, inherited]

Uploads (sets) a subrange of the buffer data.

See also:
Data
CopySubData
Exceptions:
Error
Examples:
oglplus/018_atomic_counters.cpp.

References oglplus::EnumValueName(), and OGLPLUS_CHECK.

Referenced by oglplus::BoundTemplate< Base, BaseParam, BufferOps >::SubData().

template<typename GLtype >
static void oglplus::BufferOps::SubData ( Target  target,
GLintptr  offset,
const std::vector< GLtype > &  data 
) [static, inherited]

Uploads (sets) a subrange of the buffer data.

See also:
Data
CopySubData
Exceptions:
Error

References oglplus::EnumValueName(), and OGLPLUS_CHECK.

static void oglplus::BufferOps::Unbind ( Target  target) [static, inherited]

Unbind the current buffer from the specified target.

This function binds the name 0 to the specified target.

Exceptions:
Error

References oglplus::EnumValueName(), and OGLPLUS_VERIFY.

static void oglplus::BufferOps::UnbindBase ( IndexedTarget  target,
GLuint  index 
) [static, inherited]

Unbind the current buffer from the specified indexed target.

Exceptions:
Error

References OGLPLUS_VERIFY.

static BufferUsage oglplus::BufferOps::Usage ( Target  target) [static, inherited]

Returns the buffer usage.

See also:
Access
Related OpenGL symbols:
glGetBufferParameter GL_BUFFER_USAGE
Exceptions:
Error

Referenced by oglplus::BoundTemplate< Base, BaseParam, BufferOps >::Usage().


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

Copyright © 2010-2013 Matúš Chochlík, University of Žilina, Žilina, Slovakia.
<matus.chochlik -at- fri.uniza.sk>
<chochlik -at -gmail.com>
Documentation generated on Tue May 7 2013 by Doxygen (version 1.7.6.1).