Cuda::OpenGL::BufferObject< Type, Dim > Class Template Reference

Representation of OpenGL buffer object. More...

#include <bufferobject.hpp>

Inheritance diagram for Cuda::OpenGL::BufferObject< Type, Dim >:

Inheritance graph
[legend]
Collaboration diagram for Cuda::OpenGL::BufferObject< Type, Dim >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 BufferObject (GLenum t=GL_ARRAY_BUFFER, GLenum u=GL_STATIC_DRAW)
 Default constructor.
 BufferObject (const Size< Dim > &_size, GLenum t=GL_ARRAY_BUFFER, GLenum u=GL_STATIC_DRAW)
 Constructor.
 BufferObject (const Layout< Type, Dim > &layout, GLenum t=GL_ARRAY_BUFFER, GLenum u=GL_STATIC_DRAW)
 Constructor.
void alloc ()
 Allocate buffer memory.
void alloc (const Size< Dim > &_size)
 Allocate buffer memory.
void bind ()
 Bind the buffer object to the target specified in the constructor.
void bind (GLenum t)
 Bind the buffer object to the given target.
void connect ()
 Register and map buffer object.
void disconnect ()
 Unmap and unregister buffer object.
void registerObject ()
 Register abuffer object.
void unregisterObject ()
 Unregister buffer object.
void mapBuffer ()
 Map buffer object.
void unmapBuffer ()
 Unmap buffer object.
void free ()
 Free buffer memory.
void unbind ()
 Unbind the buffer object from the target specified in the constructor.

Static Public Member Functions

static void unbind (GLenum t)
 Unbind the buffer object from the given target.


Detailed Description

template<class Type, size_t Dim>
class Cuda::OpenGL::BufferObject< Type, Dim >

Representation of OpenGL buffer object.

Constructor & Destructor Documentation

template<class Type, size_t Dim>
Cuda::OpenGL::BufferObject< Type, Dim >::BufferObject ( GLenum  t = GL_ARRAY_BUFFER,
GLenum  u = GL_STATIC_DRAW 
) [inline]

Default constructor.

Parameters:
t target to which the buffer object is bound
u usage pattern of the data store

template<class Type, size_t Dim>
Cuda::OpenGL::BufferObject< Type, Dim >::BufferObject ( const Size< Dim > &  _size,
GLenum  t = GL_ARRAY_BUFFER,
GLenum  u = GL_STATIC_DRAW 
) [inline]

Constructor.

Parameters:
_size requested size of memory block.
t target to which the buffer object is bound
u usage pattern of the data store

template<class Type, size_t Dim>
Cuda::OpenGL::BufferObject< Type, Dim >::BufferObject ( const Layout< Type, Dim > &  layout,
GLenum  t = GL_ARRAY_BUFFER,
GLenum  u = GL_STATIC_DRAW 
) [inline]

Constructor.

Parameters:
layout requested size of memory block.
t target to which the buffer object is bound
u usage pattern of the data store


Member Function Documentation

template<class Type, size_t Dim>
void Cuda::OpenGL::BufferObject< Type, Dim >::alloc ( const Size< Dim > &  _size  )  [inline]

Allocate buffer memory.

size to be allocated

Reimplemented from Cuda::Storage< Type, Dim >.

template<class Type, size_t Dim>
void Cuda::OpenGL::BufferObject< Type, Dim >::bind ( GLenum  t  )  [inline]

Bind the buffer object to the given target.

Parameters:
t target to which the buffer object should be bound

template<class Type, size_t Dim>
void Cuda::OpenGL::BufferObject< Type, Dim >::connect (  )  [inline]

Register and map buffer object.

If you called disconnect(), this must be called before using the buffer memory in a CUDA kernel.

template<class Type, size_t Dim>
void Cuda::OpenGL::BufferObject< Type, Dim >::disconnect (  )  [inline]

Unmap and unregister buffer object.

This must be called before accessing the buffer memory in OpenGL, e.g., copying the buffer data from or to a texture.

template<class Type, size_t Dim>
void Cuda::OpenGL::BufferObject< Type, Dim >::registerObject (  )  [inline]

Register abuffer object.

If you called disconnect() or unregister, this must be called before using the buffer memory in a CUDA kernel.

template<class Type, size_t Dim>
void Cuda::OpenGL::BufferObject< Type, Dim >::unregisterObject (  )  [inline]

Unregister buffer object.

This must be called before accessing the buffer memory in OpenGL for writing, e.g., copying the buffer data from a texture.

template<class Type, size_t Dim>
void Cuda::OpenGL::BufferObject< Type, Dim >::mapBuffer (  )  [inline]

Map buffer object.

This must be called before accessing buffer memory in Cuda. Note, that the buffer object must be registered in Cuda

template<class Type, size_t Dim>
void Cuda::OpenGL::BufferObject< Type, Dim >::unmapBuffer (  )  [inline]

Unmap buffer object.

This must be called before read-accessing buffer memory in OpenGL. Note, that the buffer object must be registered in Cuda.

template<class Type, size_t Dim>
static void Cuda::OpenGL::BufferObject< Type, Dim >::unbind ( GLenum  t  )  [inline, static]

Unbind the buffer object from the given target.

Parameters:
t target from which the buffer object should be unbound


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

Generated on Sun Sep 13 00:55:28 2009 for cudatemplates by  doxygen 1.5.6