#include <OGLVertexBuffer.h>
Inheritance diagram for OGLVertexBuffer:
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) |
|
Constructor |
|
Destructor |
|
(v1.3) overloaded the addTriToVB method to account for texture mapping coordinates
Implements vbInterface. |
|
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.
Implements vbInterface. |
|
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.
Implements vbInterface. |
|
This method just destroys our vertex buffer and handles any memory cleanup
Implements vbInterface. |
|
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
|
|
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.
Implements vbInterface. |
|
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
Implements vbInterface. |