|
| SlowMesh (PrimitiveType p, const shared_ptr< Texture > &t=shared_ptr< Texture >()) |
|
void | makeVertex (const Vector2 &vertex) |
| Construct a Vertex given the current texCoord, color, and normal state. More...
|
|
void | makeVertex (const Vector3 &vertex) |
|
void | makeVertex (const Vector4 &vertex) |
|
void | render (RenderDevice *rd, int coverageSamples=1) const |
| Constructs a VertexBuffer from the vertex array, and renders it using a simple shader that mimics the old fixed-function pipeline. More...
|
|
void | reserveSpace (int numVertices) |
| Call to reserve space in the CPU array for. More...
|
|
void | setColor (const Color3 &color) |
| Change the currently set color state, defaulted to black. More...
|
|
void | setColor (const Color4 &color) |
|
void | setNormal (const Vector3 &normal) |
| Change the currently set color state, defaulted to (0,0,1) More...
|
|
void | setPointSize (const float size) |
|
void | setPrimitveType (const PrimitiveType &p) |
| Overrides the current PrimitiveType, all of the create vertices will be of said type, whether made before or after this call. More...
|
|
void | setTexCoord (const Vector2 &texCoord) |
| Change the currently set texCoord state, defaulted to (0,0) More...
|
|
void | setTexture (const shared_ptr< Texture > t) |
| Sets the texture to use for rendering. More...
|
|
Used to convert old immediate mode OpenGL code to OpenGL 3+ core.
Named as such to discourage use by end-users of G3D.
Old immediate mode: rd->setTexture(0, t); glBegin(PrimitiveType::TRIANGLES); { glColor(...); glMultiTexCoord(0, ...); glVertex(...); glMultiTexCoord(0, ...); glVertex(...); glMultiTexCoord(0, ...); glVertex(...); } glEnd();
New Code: SlowMesh m(PrimitiveType::TRIANGLES); { m.setTexture(t); m.setColor(...); m.setTexCoord(...); m.makeVertex(...); m.setTexCoord(...); m.makeVertex(...); m.setTexCoord(...); m.makeVertex(...); } m.render(rd);
Alternatively, if you already have a CPUVertexArray:
SlowMesh m(PrimitiveType::TRIANGLES, cpuVertexArray, texture); m.render(rd);