PrimBuild

Engine/source/gfx/primBuilder.cpp

Primitive Builder.

More...

Public Variables

Public Functions

begin(GFXPrimitiveType type, U32 maxVerts)
color(const ColorI & inColor)
color3f(F32 red, F32 green, F32 blue)
color3i(U8 red, U8 green, U8 blue)
color4f(F32 red, F32 green, F32 blue, F32 alpha)
color4i(U8 red, U8 green, U8 blue, U8 alpha)
end(bool useGenericShaders)
vertex3f(F32 x, F32 y, F32 z)
vertex3i(S32 x, S32 y, S32 z)

Detailed Description

Primitive Builder.

A simple interface to put together lines and polygons quickly and easily - OpenGL style. This is basically a convenient way to fill a vertex buffer, then draw it.

There are two ways to use it. You can use the begin() and end() calls to have it draw immediately after calling end(). This is the "OpenGL" or "immediate" style of usage.

The other way to use this is to use the beginToBuffer() and endToBuffer() calls, which let you store the results of your intermediate calls for later use. This is much more efficient than using the immediate style.

Public Variables

const ColorI _colWhite (255, 255, 255, 255)
ColorI mCurColor (255, 255, 255)
Point2F mCurTexCoord 
U32 mCurVertIndex 
Vector< GFXVertexPCT > mTempVertBuff 
GFXPrimitiveType mType 
GFXVertexBufferHandle< GFXVertexPCT > mVertBuff 

Public Functions

begin(GFXPrimitiveType type, U32 maxVerts)

beginToBuffer(GFXPrimitiveType type, U32 maxVerts)

color(const ColorI & inColor)

color(const LinearColorF & inColor)

color3f(F32 red, F32 green, F32 blue)

color3i(U8 red, U8 green, U8 blue)

color4f(F32 red, F32 green, F32 blue, F32 alpha)

color4i(U8 red, U8 green, U8 blue, U8 alpha)

colorWhite()

end(bool useGenericShaders)

endToBuffer(U32 & numPrims)

shutdown()

texCoord2f(F32 x, F32 y)

vertex2f(F32 x, F32 y)

vertex2fv(const F32 * data)

vertex2fv(const Point2F & pnt)

vertex2fv(const Point2F * pnt)

vertex2i(S32 x, S32 y)

vertex3f(F32 x, F32 y, F32 z)

vertex3fv(const F32 * data)

vertex3fv(const Point3F & pnt)

vertex3fv(const Point3F * pnt)

vertex3i(S32 x, S32 y, S32 z)