Main Page   Class Hierarchy   Compound List   File List   Compound Members  

vbInterface Class Reference

#include <vbInterface.h>

Inheritance diagram for vbInterface:

D3DVertexBuffer OGLVertexBuffer List of all members.

Public Member Functions

 vbInterface ()
virtual ~vbInterface ()
virtual HRESULT createVB (int, VOID *=NULL)=0
virtual void destroyVB (void)=0
virtual HRESULT lockVB (void)=0
virtual void unlockVB (void)=0
virtual void addTriToVB (D3DXVECTOR3 pos, FLOAT r, FLOAT g, FLOAT b, FLOAT a)=0
virtual void flushVB (VOID)=0
virtual void addTriToVB (D3DXVECTOR3, FLOAT, FLOAT, FLOAT, FLOAT, D3DXVECTOR2)=0

Detailed Description

This object is our interface to our Vertex Buffer object which is available in both OpenGL (via extensions) or through the ID3DVertexBuffer8 interface available with DirectX8.0


Constructor & Destructor Documentation

vbInterface::vbInterface  )  [inline]
 

Constructor

virtual vbInterface::~vbInterface  )  [inline, virtual]
 

Destructor


Member Function Documentation

virtual void vbInterface::addTriToVB D3DXVECTOR3  ,
FLOAT  ,
FLOAT  ,
FLOAT  ,
FLOAT  ,
D3DXVECTOR2 
[pure virtual]
 

(v1.3) overloaded the addTriToVB method to account for texture mapping coordinates

Parameters:
D3DXVECTOR3 - (x, y, z) position of our vertex
FLOAT - red component of our vertex
FLOAT - green component of our vertex
FLOAT - blue component of our vertex
FLOAT - alpha component of our vertex
D3DXVECTOR2 - (u, v) texture mapping coordinates
Returns:
void

Implemented in D3DVertexBuffer, and OGLVertexBuffer.

virtual void vbInterface::addTriToVB D3DXVECTOR3  pos,
FLOAT  r,
FLOAT  g,
FLOAT  b,
FLOAT  a
[pure virtual]
 

This method is responsible for adding a triangle to our vertex buffer interface. Although it IS a bit of a waste having a virtual method being called for every single triangle that we add, we are just trying to create a way to demonstrate a fashion of rendering primitives with both OpenGL and Direct3D8. The reader can optimize as desired.

Parameters:
D3DXVECTOR3 - (x, y, z) position of our vertex
FLOAT - red component of our vertex
FLOAT - green component of our vertex
FLOAT - blue component of our vertex
FLOAT - alpha component of our vertex
Returns:
void

Implemented in D3DVertexBuffer, and OGLVertexBuffer.

virtual HRESULT vbInterface::createVB int  ,
VOID *  = NULL
[pure virtual]
 

This method is responsible for creating our vertex buffer interface object. Because OpenGL and Direct3D8 initialize things just a little bit differently, I decided to give us the flexibility to pass in any "extra" object that we would need to create our vertex buffer.

Parameters:
int - How many triangles our vertex buffer should hold
VOID* - A pointer to any extra creation object we need
Returns:
HRESULT - SUCCEEDED if things are ok, FAILED otherwise

Implemented in D3DVertexBuffer, and OGLVertexBuffer.

virtual void vbInterface::destroyVB void   )  [pure virtual]
 

This method just destroys our vertex buffer and handles any memory cleanup

Parameters:
void 
Returns:
void

Implemented in D3DVertexBuffer, and OGLVertexBuffer.

virtual void vbInterface::flushVB VOID   )  [pure virtual]
 

This method is just responsible for signaling to the vertex buffer that we wish to flush out the memory area of any pending triangle data

Parameters:
void 
Returns:
void

virtual HRESULT vbInterface::lockVB void   )  [pure virtual]
 

This method is responsible for locking down the vertex buffer memory. Basically the hardware will just lock down an area that we can use to add/update any triangle data.

Parameters:
void 
Returns:
HRESULT - if we SUCCEEDED or FAILED

Implemented in D3DVertexBuffer, and OGLVertexBuffer.

virtual void vbInterface::unlockVB void   )  [pure virtual]
 

This method is responsible for signalling to the vertex buffer that we are finished adding triangles. Let's unlock the video memory, so that we can perform other operations with the hardware/pipeline

Parameters:
void 
Returns:
void

Implemented in D3DVertexBuffer, and OGLVertexBuffer.


The documentation for this class was generated from the following file:
Generated on Thu Jul 3 07:23:28 2003 for GameFramework by doxygen 1.3.1