Main Page   Class Hierarchy   Compound List   File List   Compound Members  

OGLVertexBuffer Class Reference

#include <OGLVertexBuffer.h>

Inheritance diagram for OGLVertexBuffer:

vbInterface List of all members.

Public Member Functions

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

Detailed Description

This object encapsulates the OpenGL implementation of our vbInterface object. Basically it will act as a way to add triangle data to our graphics pipeline.


Constructor & Destructor Documentation

OGLVertexBuffer::OGLVertexBuffer  ) 
 

Constructor

OGLVertexBuffer::~OGLVertexBuffer  ) 
 

Destructor


Member Function Documentation

void OGLVertexBuffer::addTriToVB D3DXVECTOR3  ,
FLOAT  ,
FLOAT  ,
FLOAT  ,
FLOAT  ,
D3DXVECTOR2 
[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

Implements vbInterface.

void OGLVertexBuffer::addTriToVB D3DXVECTOR3  pos,
FLOAT  r,
FLOAT  g,
FLOAT  b,
FLOAT  a
[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

Implements vbInterface.

HRESULT OGLVertexBuffer::createVB int  ,
VOID *  = NULL
[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

Implements vbInterface.

void OGLVertexBuffer::destroyVB void   )  [virtual]
 

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

Parameters:
void 
Returns:
void

Implements vbInterface.

void OGLVertexBuffer::flushVB void   ) 
 

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

HRESULT OGLVertexBuffer::lockVB void   )  [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

Implements vbInterface.

void OGLVertexBuffer::unlockVB void   )  [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

Implements vbInterface.


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