Kochol Game Engine  0.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
kge::gfx::HardwareBuffer Class Reference

#include <HardwareBuffer.h>

Inheritance diagram for kge::gfx::HardwareBuffer:
kge::KgeUnknown kge::gfx::DynamicHardwareBuffer

Public Member Functions

 HardwareBuffer ()
 Default constructor.
 HardwareBuffer (u32 count, u32 stride, u32 id)
 Constructor.
virtual ~HardwareBuffer ()
 Destructor.
virtual bool SetData (void *Data, u32 Offset, u32 iSize, ul32 flags=0)=0
virtual HardwareBufferType GetType () const =0
 Returns the hardware buffer type.
bool Dynamic () const
void Dynamic (bool val)
u32 GetID () const
 Returns this hardware buffer unique ID.
u32 GetStride () const
 Returns this buffer stride.
u32 GetDataCount () const
virtual bool Lock (u32 offset, u32 size, void **ppData, ul32 flags)
 Locks buffer.
virtual bool Unlock ()
 Unlocks buffer.
- Public Member Functions inherited from kge::KgeUnknown
 KgeUnknown ()
 Constructor.
virtual ~KgeUnknown ()
 Destructor.
virtual void AddRef ()
 Add a reference to the object.
virtual void DecRef ()
 Decrease a reference from the object. if its reference count get 0 then the object will destroy.
u32 GetRefCount ()
 Return resource reference count.
const char * GetDebugText ()
 returns the instance debug text.

Protected Attributes

bool m_bDynamic
u32 m_iDataCount
u32 m_iStride
u32 m_iID

Additional Inherited Members

- Protected Member Functions inherited from kge::KgeUnknown
void SetDebugText (char *text)

Detailed Description

Definition at line 31 of file HardwareBuffer.h.

Constructor & Destructor Documentation

kge::gfx::HardwareBuffer::HardwareBuffer ( )
inline

Default constructor.

Definition at line 36 of file HardwareBuffer.h.

kge::gfx::HardwareBuffer::HardwareBuffer ( u32  count,
u32  stride,
u32  id 
)
inline

Constructor.

Definition at line 39 of file HardwareBuffer.h.

virtual kge::gfx::HardwareBuffer::~HardwareBuffer ( )
inlinevirtual

Destructor.

Definition at line 42 of file HardwareBuffer.h.

Member Function Documentation

bool kge::gfx::HardwareBuffer::Dynamic ( ) const
inline

Definition at line 55 of file HardwareBuffer.h.

References m_bDynamic.

void kge::gfx::HardwareBuffer::Dynamic ( bool  val)
inline

Definition at line 58 of file HardwareBuffer.h.

References m_bDynamic.

u32 kge::gfx::HardwareBuffer::GetDataCount ( ) const
inline

Definition at line 66 of file HardwareBuffer.h.

References m_iDataCount.

u32 kge::gfx::HardwareBuffer::GetID ( ) const
inline

Returns this hardware buffer unique ID.

Definition at line 61 of file HardwareBuffer.h.

References m_iID.

u32 kge::gfx::HardwareBuffer::GetStride ( ) const
inline

Returns this buffer stride.

Definition at line 64 of file HardwareBuffer.h.

References m_iStride.

virtual HardwareBufferType kge::gfx::HardwareBuffer::GetType ( ) const
pure virtual

Returns the hardware buffer type.

Implemented in kge::gfx::DynamicHardwareBuffer.

virtual bool kge::gfx::HardwareBuffer::Lock ( u32  offset,
u32  size,
void **  ppData,
ul32  flags 
)
inlinevirtual

Locks buffer.

Definition at line 69 of file HardwareBuffer.h.

virtual bool kge::gfx::HardwareBuffer::SetData ( void *  Data,
u32  Offset,
u32  iSize,
ul32  flags = 0 
)
pure virtual

sets the buffer data if buffer is dynamic.

Parameters
DataThe data pointer
OffsetThe offset in data count for example if Offset is 2 and it is a vertex buffer the offset means two vertex size not two byte
iSizeThe size in data count not in bytes

Implemented in kge::gfx::DynamicHardwareBuffer.

virtual bool kge::gfx::HardwareBuffer::Unlock ( )
inlinevirtual

Unlocks buffer.

Definition at line 72 of file HardwareBuffer.h.

Member Data Documentation

bool kge::gfx::HardwareBuffer::m_bDynamic
protected

Definition at line 76 of file HardwareBuffer.h.

Referenced by Dynamic().

u32 kge::gfx::HardwareBuffer::m_iDataCount
protected

Definition at line 78 of file HardwareBuffer.h.

Referenced by GetDataCount().

u32 kge::gfx::HardwareBuffer::m_iID
protected

Definition at line 78 of file HardwareBuffer.h.

Referenced by GetID().

u32 kge::gfx::HardwareBuffer::m_iStride
protected

Definition at line 78 of file HardwareBuffer.h.

Referenced by GetStride().


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