OgreHardwareIndexBuffer.h
Go to the documentation of this file.
/*
-----------------------------------------------------------------------------
This source file is part of OGRE
(Object-oriented Graphics Rendering Engine)
For the latest info, see http://www.ogre3d.org/
Copyright (c) 2000-2013 Torus Knot Software Ltd
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
-----------------------------------------------------------------------------
*/
#ifndef __HardwareIndexBuffer__
#define __HardwareIndexBuffer__
// Precompiler options
#include "OgrePrerequisites.h"
#include "OgreHardwareBuffer.h"
#include "OgreSharedPtr.h"
namespace Ogre {
class HardwareBufferManagerBase;
class _OgreExport HardwareIndexBuffer : public HardwareBuffer
{
public:
enum IndexType {
IT_16BIT,
IT_32BIT
};
protected:
HardwareBufferManagerBase* mMgr;
IndexType mIndexType;
size_t mNumIndexes;
size_t mIndexSize;
public:
HardwareIndexBuffer(HardwareBufferManagerBase* mgr, IndexType idxType, size_t numIndexes, HardwareBuffer::Usage usage,
bool useSystemMemory, bool useShadowBuffer);
~HardwareIndexBuffer();
HardwareBufferManagerBase* getManager() const { return mMgr; }
IndexType getType(void) const { return mIndexType; }
size_t getNumIndexes(void) const { return mNumIndexes; }
size_t getIndexSize(void) const { return mIndexSize; }
// NB subclasses should override lock, unlock, readData, writeData
};
class _OgreExport HardwareIndexBufferSharedPtr : public SharedPtr<HardwareIndexBuffer>
{
public:
HardwareIndexBufferSharedPtr() : SharedPtr<HardwareIndexBuffer>() {}
explicit HardwareIndexBufferSharedPtr(HardwareIndexBuffer* buf);
};
typedef HardwareBufferLockGuard<HardwareIndexBufferSharedPtr> HardwareIndexBufferLockGuard;
}
#endif
Ogre::HardwareIndexBuffer::getIndexSize
size_t getIndexSize(void) const
Get the size in bytes of each index.
Definition: OgreHardwareIndexBuffer.h:72
_OgreExport
#define _OgreExport
Definition: OgrePlatform.h:257
Ogre::HardwareIndexBufferSharedPtr
Shared pointer implementation used to share index buffers.
Definition: OgreHardwareIndexBuffer.h:79
OgreSharedPtr.h
Ogre::HardwareIndexBufferSharedPtr::HardwareIndexBufferSharedPtr
HardwareIndexBufferSharedPtr()
Definition: OgreHardwareIndexBuffer.h:82
Ogre::HardwareIndexBufferLockGuard
HardwareBufferLockGuard< HardwareIndexBufferSharedPtr > HardwareIndexBufferLockGuard
Locking helper.
Definition: OgreHardwareIndexBuffer.h:87
Ogre::HardwareIndexBuffer::getNumIndexes
size_t getNumIndexes(void) const
Get the number of indexes in this buffer.
Definition: OgreHardwareIndexBuffer.h:70
Ogre::HardwareIndexBuffer
Specialisation of HardwareBuffer for vertex index buffers, still abstract.
Definition: OgreHardwareIndexBuffer.h:46
Ogre::HardwareIndexBuffer::mNumIndexes
size_t mNumIndexes
Definition: OgreHardwareIndexBuffer.h:57
OgrePrerequisites.h
Ogre::HardwareBufferManagerBase
Base definition of a hardware buffer manager.
Definition: OgreHardwareBufferManager.h:113
Ogre::HardwareIndexBuffer::getManager
HardwareBufferManagerBase * getManager() const
Return the manager of this buffer, if any.
Definition: OgreHardwareIndexBuffer.h:66
Ogre::HardwareIndexBuffer::mIndexType
IndexType mIndexType
Definition: OgreHardwareIndexBuffer.h:56
Ogre::HardwareIndexBuffer::mMgr
HardwareBufferManagerBase * mMgr
Definition: OgreHardwareIndexBuffer.h:55
Ogre::HardwareIndexBuffer::IT_16BIT
Definition: OgreHardwareIndexBuffer.h:50
Ogre::HardwareBuffer::Usage
Usage
Enums describing buffer usage; not mutually exclusive.
Definition: OgreHardwareBuffer.h:79
Ogre::HardwareBuffer
Abstract class defining common features of hardware buffers.
Definition: OgreHardwareBuffer.h:74
Ogre::HardwareIndexBuffer::getType
IndexType getType(void) const
Get the type of indexes used in this buffer.
Definition: OgreHardwareIndexBuffer.h:68
Ogre::HardwareIndexBuffer::IndexType
IndexType
Definition: OgreHardwareIndexBuffer.h:49
Ogre::HardwareBufferLockGuard
Locking helper.
Definition: OgreHardwareBuffer.h:357
Ogre
Definition: OgreAndroidLogListener.h:34
OgreHardwareBuffer.h
Ogre::SharedPtr
Reference-counted shared pointer, used for objects where implicit destruction is required.
Definition: OgrePrerequisites.h:310
Ogre::HardwareIndexBuffer::mIndexSize
size_t mIndexSize
Definition: OgreHardwareIndexBuffer.h:58

Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.