OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Member Functions | Private Attributes | List of all members
Terrain::BufferCache Class Reference

Implements creation and caching of vertex buffers for terrain chunks. More...

#include <buffercache.hpp>

Collaboration diagram for Terrain::BufferCache:

Public Member Functions

 BufferCache (unsigned int numVerts)
 
osg::ref_ptr< osg::DrawElements > getIndexBuffer (unsigned int flags)
 
osg::ref_ptr< osg::Vec2Array > getUVBuffer ()
 

Private Attributes

std::map< int, osg::ref_ptr
< osg::DrawElements > > 
mIndexBufferMap
 
OpenThreads::Mutex mIndexBufferMutex
 
std::map< int, osg::ref_ptr
< osg::Vec2Array > > 
mUvBufferMap
 
OpenThreads::Mutex mUvBufferMutex
 
unsigned int mNumVerts
 

Detailed Description

Implements creation and caching of vertex buffers for terrain chunks.

Constructor & Destructor Documentation

Terrain::BufferCache::BufferCache ( unsigned int  numVerts)
inline

Member Function Documentation

osg::ref_ptr< osg::DrawElements > Terrain::BufferCache::getIndexBuffer ( unsigned int  flags)
Parameters
flagsfirst 4*4 bits are LOD deltas on each edge, respectively (4 bits each) next 4 bits are LOD level of the index buffer (LOD 0 = don't omit any vertices)
Note
Thread safe.

Here is the caller graph for this function:

osg::ref_ptr< osg::Vec2Array > Terrain::BufferCache::getUVBuffer ( )
Note
Thread safe.

Here is the caller graph for this function:

Member Data Documentation

std::map<int, osg::ref_ptr<osg::DrawElements> > Terrain::BufferCache::mIndexBufferMap
private
OpenThreads::Mutex Terrain::BufferCache::mIndexBufferMutex
private
unsigned int Terrain::BufferCache::mNumVerts
private
std::map<int, osg::ref_ptr<osg::Vec2Array> > Terrain::BufferCache::mUvBufferMap
private
OpenThreads::Mutex Terrain::BufferCache::mUvBufferMutex
private

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