GFXDrawUtil

Engine/source/gfx/gfxDrawUtil.h

Helper class containing utility functions for useful drawing routines (line, box, rect, billboard, text).

More...

Public Types

enum
Plane {
  PlaneXY 
  PlaneXZ 
  PlaneYZ 
}

Protected Attributes

Bitmap modulation color; bitmaps are multiplied by this color when drawn.

The device we're rendering to.

Base text color; what color text is drawn at when no other color is specified.

Public Functions

draw2DSquare(const Point2F & screenPoint, F32 width, F32 spinAngle)
drawArrow(const GFXStateBlockDesc & desc, const Point3F & start, const Point3F & end, const ColorI & color, F32 baseRad)
drawBitmap(GFXTextureObject * texture, const Point2F & in_rAt, const GFXBitmapFlip in_flip, const GFXTextureFilterType filter, bool in_wrap)
drawBitmap(GFXTextureObject * texture, const Point2I & in_rAt, const GFXBitmapFlip in_flip, const GFXTextureFilterType filter, bool in_wrap)
drawBitmapSR(GFXTextureObject * texture, const Point2F & in_rAt, const RectF & srcRect, const GFXBitmapFlip in_flip, const GFXTextureFilterType filter, bool in_wrap)
drawBitmapSR(GFXTextureObject * texture, const Point2I & in_rAt, const RectI & srcRect, const GFXBitmapFlip in_flip, const GFXTextureFilterType filter, bool in_wrap)
drawBitmapStretch(GFXTextureObject * texture, const RectF & dstRect, const GFXBitmapFlip in_flip, const GFXTextureFilterType filter, bool in_wrap)
drawBitmapStretch(GFXTextureObject * texture, const RectI & dstRect, const GFXBitmapFlip in_flip, const GFXTextureFilterType filter, bool in_wrap)
drawBitmapStretchSR(GFXTextureObject * texture, const RectF & dstRect, const RectF & srcRect, const GFXBitmapFlip in_flip, const GFXTextureFilterType filter, bool in_wrap)
drawBitmapStretchSR(GFXTextureObject * texture, const RectI & dstRect, const RectI & srcRect, const GFXBitmapFlip in_flip, const GFXTextureFilterType filter, bool in_wrap)
drawCapsule(const GFXStateBlockDesc & desc, const Point3F & center, F32 radius, F32 height, const ColorI & color, const MatrixF * xfm)
drawCone(const GFXStateBlockDesc & desc, const Point3F & basePnt, const Point3F & tipPnt, F32 baseRadius, const ColorI & color)
drawCylinder(const GFXStateBlockDesc & desc, const Point3F & basePnt, const Point3F & tipPnt, F32 baseRadius, const ColorI & color)
drawLine(const Point2F & startPt, const Point2F & endPt, const ColorI & color)
drawLine(const Point2I & startPt, const Point2I & endPt, const ColorI & color)
drawLine(const Point3F & startPt, const Point3F & endPt, const ColorI & color)
drawLine(F32 x1, F32 y1, F32 x2, F32 y2, const ColorI & color)
drawLine(F32 x1, F32 y1, F32 z1, F32 x2, F32 y2, F32 z2, const ColorI & color)
drawPlaneGrid(const GFXStateBlockDesc & desc, const Point3F & pos, const Point2F & size, const Point2F & step, const ColorI & color, Plane plane)

Draws a grid on XY, XZ, or YZ plane centered on the point with the specified size and step size.

drawPolygon(const GFXStateBlockDesc & desc, const Point3F * points, U32 numPoints, const ColorI & color, const MatrixF * xfm)

Draw a solid or wireframe (depending on fill mode of desc) polyhedron with the given color.

drawRect(const Point2F & upperLeft, const Point2F & lowerRight, const ColorI & color)
drawRect(const Point2I & upperLeft, const Point2I & lowerRight, const ColorI & color)
drawRect(const RectF & rect, const ColorI & color)
drawRect(const RectI & rect, const ColorI & color)
drawRectFill(const Point2F & upperL, const Point2F & lowerR, const ColorI & color)
drawRectFill(const Point2I & upperLeft, const Point2I & lowerRight, const ColorI & color)

Draws a solid XY plane centered on the point with the specified dimensions.

drawSphere(const GFXStateBlockDesc & desc, F32 radius, const Point3F & pos, const ColorI & color, bool drawTop, bool drawBottom, const MatrixF * xfm)
drawText(GFont * font, const Point2F & ptDraw, const UTF16 * in_string, const ColorI * colorTable, const U32 maxColorIndex, F32 rot)
drawText(GFont * font, const Point2F & ptDraw, const UTF8 * in_string, const ColorI * colorTable, const U32 maxColorIndex, F32 rot)
drawText(GFont * font, const Point2I & ptDraw, const UTF16 * in_string, const ColorI * colorTable, const U32 maxColorIndex, F32 rot)
drawText(GFont * font, const Point2I & ptDraw, const UTF8 * in_string, const ColorI * colorTable, const U32 maxColorIndex, F32 rot)
drawTextN(GFont * font, const Point2F & ptDraw, const UTF16 * in_string, U32 n, const ColorI * colorTable, const U32 maxColorIndex, F32 rot)
drawTextN(GFont * font, const Point2F & ptDraw, const UTF8 * in_string, U32 n, const ColorI * colorTable, const U32 maxColorIndex, F32 rot)
drawTextN(GFont * font, const Point2I & ptDraw, const UTF16 * in_string, U32 n, const ColorI * colorTable, const U32 maxColorIndex, F32 rot)
drawTextN(GFont * font, const Point2I & ptDraw, const UTF8 * in_string, U32 n, const ColorI * colorTable, const U32 maxColorIndex, F32 rot)

Draws axis lines representing the passed matrix.

Detailed Description

Helper class containing utility functions for useful drawing routines (line, box, rect, billboard, text).

Public Types

Plane

Enumerator

PlaneXY
PlaneXZ
PlaneYZ

Protected Attributes

GFXVertexColor mBitmapModulation 

Bitmap modulation color; bitmaps are multiplied by this color when drawn.

GFXStateBlockRef mBitmapStretchLinearSB 
GFXStateBlockRef mBitmapStretchSB 
GFXStateBlockRef mBitmapStretchWrapLinearSB 
GFXStateBlockRef mBitmapStretchWrapSB 
GFXDevice * mDevice 

The device we're rendering to.

FontRenderBatcher * mFontRenderBatcher 
GFXStateBlockRef mRectFillSB 
GFXVertexColor mTextAnchorColor 

Base text color; what color text is drawn at when no other color is specified.

Public Functions

GFXDrawUtil(GFXDevice * )

~GFXDrawUtil()

clearBitmapModulation()

draw2DSquare(const Point2F & screenPoint, F32 width, F32 spinAngle)

drawArrow(const GFXStateBlockDesc & desc, const Point3F & start, const Point3F & end, const ColorI & color, F32 baseRad)

drawBitmap(GFXTextureObject * texture, const Point2F & in_rAt, const GFXBitmapFlip in_flip, const GFXTextureFilterType filter, bool in_wrap)

drawBitmap(GFXTextureObject * texture, const Point2I & in_rAt, const GFXBitmapFlip in_flip, const GFXTextureFilterType filter, bool in_wrap)

drawBitmapSR(GFXTextureObject * texture, const Point2F & in_rAt, const RectF & srcRect, const GFXBitmapFlip in_flip, const GFXTextureFilterType filter, bool in_wrap)

drawBitmapSR(GFXTextureObject * texture, const Point2I & in_rAt, const RectI & srcRect, const GFXBitmapFlip in_flip, const GFXTextureFilterType filter, bool in_wrap)

drawBitmapStretch(GFXTextureObject * texture, const RectF & dstRect, const GFXBitmapFlip in_flip, const GFXTextureFilterType filter, bool in_wrap)

drawBitmapStretch(GFXTextureObject * texture, const RectI & dstRect, const GFXBitmapFlip in_flip, const GFXTextureFilterType filter, bool in_wrap)

drawBitmapStretchSR(GFXTextureObject * texture, const RectF & dstRect, const RectF & srcRect, const GFXBitmapFlip in_flip, const GFXTextureFilterType filter, bool in_wrap)

drawBitmapStretchSR(GFXTextureObject * texture, const RectI & dstRect, const RectI & srcRect, const GFXBitmapFlip in_flip, const GFXTextureFilterType filter, bool in_wrap)

drawCapsule(const GFXStateBlockDesc & desc, const Point3F & center, F32 radius, F32 height, const ColorI & color, const MatrixF * xfm)

drawCone(const GFXStateBlockDesc & desc, const Point3F & basePnt, const Point3F & tipPnt, F32 baseRadius, const ColorI & color)

drawCube(const GFXStateBlockDesc & desc, const Box3F & box, const ColorI & color, const MatrixF * xfm)

drawCube(const GFXStateBlockDesc & desc, const Point3F & size, const Point3F & pos, const ColorI & color, const MatrixF * xfm)

drawCylinder(const GFXStateBlockDesc & desc, const Point3F & basePnt, const Point3F & tipPnt, F32 baseRadius, const ColorI & color)

drawFrustum(const Frustum & f, const ColorI & color)

drawLine(const Point2F & startPt, const Point2F & endPt, const ColorI & color)

drawLine(const Point2I & startPt, const Point2I & endPt, const ColorI & color)

drawLine(const Point3F & startPt, const Point3F & endPt, const ColorI & color)

drawLine(F32 x1, F32 y1, F32 x2, F32 y2, const ColorI & color)

drawLine(F32 x1, F32 y1, F32 z1, F32 x2, F32 y2, F32 z2, const ColorI & color)

drawObjectBox(const GFXStateBlockDesc & desc, const Point3F & size, const Point3F & pos, const MatrixF & objMat, const ColorI & color)

drawPlaneGrid(const GFXStateBlockDesc & desc, const Point3F & pos, const Point2F & size, const Point2F & step, const ColorI & color, Plane plane)

Draws a grid on XY, XZ, or YZ plane centered on the point with the specified size and step size.

drawPolygon(const GFXStateBlockDesc & desc, const Point3F * points, U32 numPoints, const ColorI & color, const MatrixF * xfm)

drawPolyhedron(const GFXStateBlockDesc & desc, const AnyPolyhedron & poly, const ColorI & color, const MatrixF * xfm)

Draw a solid or wireframe (depending on fill mode of desc) polyhedron with the given color.

Parameters:

desc

Render state description.

poly

Polyhedron.

color

Color.

xfm

Optional matrix to transform all vertices of the given polyhedron by.

drawRect(const Point2F & upperLeft, const Point2F & lowerRight, const ColorI & color)

drawRect(const Point2I & upperLeft, const Point2I & lowerRight, const ColorI & color)

drawRect(const RectF & rect, const ColorI & color)

drawRect(const RectI & rect, const ColorI & color)

drawRectFill(const Point2F & upperL, const Point2F & lowerR, const ColorI & color)

drawRectFill(const Point2I & upperLeft, const Point2I & lowerRight, const ColorI & color)

drawRectFill(const RectF & rect, const ColorI & color)

drawRectFill(const RectI & rect, const ColorI & color)

drawSolidPlane(const GFXStateBlockDesc & desc, const Point3F & pos, const Point2F & size, const ColorI & color)

Draws a solid XY plane centered on the point with the specified dimensions.

drawSphere(const GFXStateBlockDesc & desc, F32 radius, const Point3F & pos, const ColorI & color, bool drawTop, bool drawBottom, const MatrixF * xfm)

drawText(GFont * font, const Point2F & ptDraw, const UTF16 * in_string, const ColorI * colorTable, const U32 maxColorIndex, F32 rot)

drawText(GFont * font, const Point2F & ptDraw, const UTF8 * in_string, const ColorI * colorTable, const U32 maxColorIndex, F32 rot)

drawText(GFont * font, const Point2I & ptDraw, const UTF16 * in_string, const ColorI * colorTable, const U32 maxColorIndex, F32 rot)

drawText(GFont * font, const Point2I & ptDraw, const UTF8 * in_string, const ColorI * colorTable, const U32 maxColorIndex, F32 rot)

drawTextN(GFont * font, const Point2F & ptDraw, const UTF16 * in_string, U32 n, const ColorI * colorTable, const U32 maxColorIndex, F32 rot)

drawTextN(GFont * font, const Point2F & ptDraw, const UTF8 * in_string, U32 n, const ColorI * colorTable, const U32 maxColorIndex, F32 rot)

drawTextN(GFont * font, const Point2I & ptDraw, const UTF16 * in_string, U32 n, const ColorI * colorTable, const U32 maxColorIndex, F32 rot)

drawTextN(GFont * font, const Point2I & ptDraw, const UTF8 * in_string, U32 n, const ColorI * colorTable, const U32 maxColorIndex, F32 rot)

drawTransform(const GFXStateBlockDesc & desc, const MatrixF & mat, const Point3F * scale, const ColorI colors)

Draws axis lines representing the passed matrix.

If scale is NULL axes will be drawn the length they exist within the MatrixF. If colors is NULL the default colors are RED, GREEEN, BLUE ( x, y, z ).

drawTriangle(const GFXStateBlockDesc & desc, const Point3F & p0, const Point3F & p1, const Point3F & p2, const ColorI & color, const MatrixF * xfm)

getBitmapModulation(ColorI * color)

setBitmapModulation(const ColorI & modColor)

setTextAnchorColor(const ColorI & ancColor)