Graphics Reference
In-Depth Information
#include “vertexarray.h”
GLfloat CubeVertices[ ][3] =
{
{ -1., -1., -1. },
{ 1., -1., -1. },
{ -1., 1., -1. },
{ 1., 1., -1. },
{ -1., -1., 1. },
{ 1., -1., 1. },
{ -1., 1., 1. },
{ 1., 1., 1. }
};
GLfloat CubeColors[ ][3] =
{
{ 0., 0., 0. },
{ 1., 0., 0. },
{ 0., 1., 0. },
{ 1., 1., 0. },
{ 0., 0., 1. },
{ 1., 0., 1. },
{ 0., 1., 1. },
{ 1., 1., 1. }
};
GLuint CubeIndices[ ][4] =
{
{ 0, 2, 3, 1 },
{ 4, 5, 7, 6 },
{ 1, 3, 7, 5 },
{ 0, 4, 6, 2 },
{ 2, 6, 7, 3 },
{ 0, 1, 5, 4 }
};
VertexArray *VA;
. . .
// this goes in the part of the program where graphics things
// get initialized once:
VA = new VertexArray( ); // create an instance of the class
// the real “constructor” is in the glBegin method
Search WWH ::




Custom Search