PixelLightAPI
.
|
Abstract draw helpers interface. More...
#include <DrawHelpers.h>
Public Member Functions | |
virtual void | Begin2DMode (float fX1=0.0f, float fY1=0.0f, float fX2=1.0f, float fY2=1.0f)=0 |
Begin 2D mode. | |
virtual bool | Is2DMode () const =0 |
Returns whether the renderer is currently in the 2D mode or not. | |
virtual bool | Get2DMode (float &fX1, float &fY1, float &fX2, float &fY2) const =0 |
Returns the virtual 2D mode screen size. | |
virtual void | End2DMode ()=0 |
End 2D mode. | |
virtual float | Get2DZValue () const =0 |
Returns the z value to be used for 2D rendering. | |
virtual void | Set2DZValue (float fZValue=0.0f)=0 |
Sets the Z Value to be used for 2D rendering. | |
virtual const PLMath::Matrix4x4 & | GetObjectSpaceToClipSpaceMatrix () const =0 |
Returns the 2D mode object space to clip space matrix. | |
virtual void | DrawText (Font &cFont, const PLCore::String &sText, const PLGraphics::Color4 &cColor, const PLMath::Vector2 &vPosition, PLCore::uint32 nFlags=0, const PLMath::Vector2 &vScale=PLMath::Vector2::One, const PLMath::Vector2 &vBias=PLMath::Vector2::Zero)=0 |
Draws a text at a given 2D position. | |
virtual void | DrawText (Font &cFont, const PLCore::String &sText, const PLGraphics::Color4 &cColor, const PLMath::Vector3 &vPosition, const PLMath::Matrix4x4 &mObjectSpaceToClipSpace, PLCore::uint32 nFlags=0, const PLMath::Vector2 &vScale=PLMath::Vector2::One, const PLMath::Vector2 &vBias=PLMath::Vector2::Zero)=0 |
Draws a text at a given 3D position. | |
virtual float | GetTextWidth (Font &cFont, const PLCore::String &sText) const =0 |
Returns the width of a text. | |
virtual float | GetTextHeight (Font &cFont) const =0 |
Returns the height of a font. | |
virtual void | DrawImage (TextureBuffer &cTextureBuffer, SamplerStates &cSamplerStates, const PLMath::Vector2 &vPos, const PLMath::Vector2 &vSize=PLMath::Vector2::Zero, const PLGraphics::Color4 &cColor=PLGraphics::Color4::White, float fAlphaReference=1.0f, const PLMath::Vector2 &vTextureCoordinate=PLMath::Vector2::Zero, const PLMath::Vector2 &vTextureCoordinateSize=PLMath::Vector2::One, const PLMath::Matrix4x4 &mTexture=PLMath::Matrix4x4::Identity)=0 |
Draws an image using a given 2D position. | |
virtual void | DrawImage (TextureBuffer &cTextureBuffer, SamplerStates &cSamplerStates, const PLMath::Vector3 &vPos, const PLMath::Matrix4x4 &mObjectSpaceToClipSpace, const PLMath::Vector2 &vSize=PLMath::Vector2::Zero, const PLGraphics::Color4 &cColor=PLGraphics::Color4::White, float fAlphaReference=1.0f, const PLMath::Vector2 &vTextureCoordinate=PLMath::Vector2::Zero, const PLMath::Vector2 &vTextureCoordinateSize=PLMath::Vector2::One, const PLMath::Matrix4x4 &mTexture=PLMath::Matrix4x4::Identity)=0 |
Draws an image using a given 3D position. | |
virtual void | DrawPoint (const PLGraphics::Color4 &cColor, const PLMath::Vector2 &vPosition, float fSize=1.0f)=0 |
Draws a single colored point using a given 2D position. | |
virtual void | DrawPoint (const PLGraphics::Color4 &cColor, const PLMath::Vector3 &vPosition, const PLMath::Matrix4x4 &mObjectSpaceToClipSpace, float fSize=1.0f)=0 |
Draws a single colored point using a given 3D position. | |
virtual void | DrawLine (const PLGraphics::Color4 &cColor, const PLMath::Vector2 &vStartPosition, const PLMath::Vector2 &vEndPosition, float fWidth=1.0f)=0 |
Draws a single colored line using a given 2D start position and 2D end position. | |
virtual void | DrawLine (const PLGraphics::Color4 &cColor, const PLMath::Vector3 &vStartPosition, const PLMath::Vector3 &vEndPosition, const PLMath::Matrix4x4 &mObjectSpaceToClipSpace, float fWidth=1.0f)=0 |
Draws a single colored line using a given 3D start position and 3D end position. | |
virtual void | DrawTriangle (const PLGraphics::Color4 &cColor, const PLMath::Vector3 &vV1, const PLMath::Vector3 &vV2, const PLMath::Vector3 &vV3, const PLMath::Matrix4x4 &mObjectSpaceToClipSpace, float fWidth=0.0f)=0 |
Draws a colored triangle. | |
virtual void | DrawQuad (const PLGraphics::Color4 &cColor, const PLMath::Vector2 &vPos, const PLMath::Vector2 &vSize, float fWidth=0.0f)=0 |
Draws a colored 2D quad. | |
virtual void | DrawQuad (const PLGraphics::Color4 &cColor, const PLMath::Vector3 &vV1, const PLMath::Vector3 &vV2, const PLMath::Vector3 &vV3, const PLMath::Vector3 &vV4, const PLMath::Matrix4x4 &mObjectSpaceToClipSpace, float fWidth=0.0f)=0 |
Draws a colored quad using given 3D positions. | |
virtual void | DrawGradientQuad (const PLGraphics::Color4 &cColor1, const PLGraphics::Color4 &cColor2, float fAngle, const PLMath::Vector2 &vPos, const PLMath::Vector2 &vSize)=0 |
Draws a gradient colored 2D quad. | |
virtual void | DrawGradientQuad (const PLGraphics::Color4 &cColor1, const PLGraphics::Color4 &cColor2, float fAngle, const PLMath::Vector3 &vV1, const PLMath::Vector3 &vV2, const PLMath::Vector3 &vV3, const PLMath::Vector3 &vV4, const PLMath::Matrix4x4 &mObjectSpaceToClipSpace)=0 |
Draws a gradient colored quad using given 3D positions. | |
virtual void | DrawBox (const PLGraphics::Color4 &cColor, const PLMath::Vector3 &vMin, const PLMath::Vector3 &vMax, const PLMath::Matrix4x4 &mObjectSpaceToClipSpace, float fWidth=0.0f)=0 |
Draws a colored box. | |
virtual void | DrawPlane (const PLGraphics::Color4 &cColor, const PLMath::Vector3 &vN, float fD, const PLMath::Matrix4x4 &mObjectSpaceToClipSpace, float fSize=10000.0f, float fLineWidth=1.0f)=0 |
Draws a colored plane. | |
Protected Member Functions | |
PLRENDERER_API | DrawHelpers () |
Constructor. | |
virtual PLRENDERER_API | ~DrawHelpers () |
Destructor. |
Abstract draw helpers interface.
(0, 0) |------ | | (Width, Height)
The origin is at the upper left which is also usually true for GUI systems.
PLRENDERER_API PLRenderer::DrawHelpers::DrawHelpers | ( | ) | [protected] |
Constructor.
virtual PLRENDERER_API PLRenderer::DrawHelpers::~DrawHelpers | ( | ) | [protected, virtual] |
Destructor.
virtual void PLRenderer::DrawHelpers::Begin2DMode | ( | float | fX1 = 0.0f , |
float | fY1 = 0.0f , |
||
float | fX2 = 1.0f , |
||
float | fY2 = 1.0f |
||
) | [pure virtual] |
Begin 2D mode.
[in] | fX1 | Virtual screen x start position |
[in] | fY1 | Virtual screen y start position |
[in] | fX2 | Virtual screen x end position |
[in] | fY2 | Virtual screen y end position |
virtual bool PLRenderer::DrawHelpers::Is2DMode | ( | ) | const [pure virtual] |
Returns whether the renderer is currently in the 2D mode or not.
virtual bool PLRenderer::DrawHelpers::Get2DMode | ( | float & | fX1, |
float & | fY1, | ||
float & | fX2, | ||
float & | fY2 | ||
) | const [pure virtual] |
Returns the virtual 2D mode screen size.
[out] | fX1 | Will receive the virtual screen x start position |
[out] | fY1 | Will receive the virtual screen y start position |
[out] | fX2 | Will receive the virtual screen x end position |
[out] | fY2 | Will receive the virtual screen y end position |
virtual void PLRenderer::DrawHelpers::End2DMode | ( | ) | [pure virtual] |
End 2D mode.
virtual float PLRenderer::DrawHelpers::Get2DZValue | ( | ) | const [pure virtual] |
Returns the z value to be used for 2D rendering.
virtual void PLRenderer::DrawHelpers::Set2DZValue | ( | float | fZValue = 0.0f | ) | [pure virtual] |
Sets the Z Value to be used for 2D rendering.
[in] | fZValue | Z value |
virtual const PLMath::Matrix4x4& PLRenderer::DrawHelpers::GetObjectSpaceToClipSpaceMatrix | ( | ) | const [pure virtual] |
Returns the 2D mode object space to clip space matrix.
virtual void PLRenderer::DrawHelpers::DrawText | ( | Font & | cFont, |
const PLCore::String & | sText, | ||
const PLGraphics::Color4 & | cColor, | ||
const PLMath::Vector2 & | vPosition, | ||
PLCore::uint32 | nFlags = 0 , |
||
const PLMath::Vector2 & | vScale = PLMath::Vector2::One , |
||
const PLMath::Vector2 & | vBias = PLMath::Vector2::Zero |
||
) | [pure virtual] |
Draws a text at a given 2D position.
[in] | cFont | Font to use |
[in] | sText | Text to draw |
[in] | cColor | Text color |
[in] | vPosition | Text screen position |
[in] | nFlags | Draw flags, see Font::EDrawFlags |
[in] | vScale | Font scale |
[in] | vBias | Font bias (position offset) |
virtual void PLRenderer::DrawHelpers::DrawText | ( | Font & | cFont, |
const PLCore::String & | sText, | ||
const PLGraphics::Color4 & | cColor, | ||
const PLMath::Vector3 & | vPosition, | ||
const PLMath::Matrix4x4 & | mObjectSpaceToClipSpace, | ||
PLCore::uint32 | nFlags = 0 , |
||
const PLMath::Vector2 & | vScale = PLMath::Vector2::One , |
||
const PLMath::Vector2 & | vBias = PLMath::Vector2::Zero |
||
) | [pure virtual] |
Draws a text at a given 3D position.
[in] | cFont | Font to use |
[in] | sText | Text to draw |
[in] | cColor | Text color |
[in] | vPosition | Text object space position |
[in] | mObjectSpaceToClipSpace | Object space to clip space matrix |
[in] | nFlags | Draw flags, see Font::EDrawFlags |
[in] | vScale | Font scale |
[in] | vBias | Font bias (position offset) |
virtual float PLRenderer::DrawHelpers::GetTextWidth | ( | Font & | cFont, |
const PLCore::String & | sText | ||
) | const [pure virtual] |
Returns the width of a text.
[in] | cFont | Font to use |
[in] | sText | Text to 'draw' |
virtual float PLRenderer::DrawHelpers::GetTextHeight | ( | Font & | cFont | ) | const [pure virtual] |
virtual void PLRenderer::DrawHelpers::DrawImage | ( | TextureBuffer & | cTextureBuffer, |
SamplerStates & | cSamplerStates, | ||
const PLMath::Vector2 & | vPos, | ||
const PLMath::Vector2 & | vSize = PLMath::Vector2::Zero , |
||
const PLGraphics::Color4 & | cColor = PLGraphics::Color4::White , |
||
float | fAlphaReference = 1.0f , |
||
const PLMath::Vector2 & | vTextureCoordinate = PLMath::Vector2::Zero , |
||
const PLMath::Vector2 & | vTextureCoordinateSize = PLMath::Vector2::One , |
||
const PLMath::Matrix4x4 & | mTexture = PLMath::Matrix4x4::Identity |
||
) | [pure virtual] |
Draws an image using a given 2D position.
[in] | cTextureBuffer | Texture buffer holding the image to draw |
[in] | cSamplerStates | Sampler states |
[in] | vPos | Image position |
[in] | vSize | Image size |
[in] | cColor | Color to use |
[in] | fAlphaReference | Alpha test reference value (0-1), all texels below the value will be discarded, if >= 1, no alpha test will be performed |
[in] | vTextureCoordinate | Normalized texture coordinate (0..1) |
[in] | vTextureCoordinateSize | Normalized texture coordinate size (0..1) |
[in] | mTexture | Texture matrix |
virtual void PLRenderer::DrawHelpers::DrawImage | ( | TextureBuffer & | cTextureBuffer, |
SamplerStates & | cSamplerStates, | ||
const PLMath::Vector3 & | vPos, | ||
const PLMath::Matrix4x4 & | mObjectSpaceToClipSpace, | ||
const PLMath::Vector2 & | vSize = PLMath::Vector2::Zero , |
||
const PLGraphics::Color4 & | cColor = PLGraphics::Color4::White , |
||
float | fAlphaReference = 1.0f , |
||
const PLMath::Vector2 & | vTextureCoordinate = PLMath::Vector2::Zero , |
||
const PLMath::Vector2 & | vTextureCoordinateSize = PLMath::Vector2::One , |
||
const PLMath::Matrix4x4 & | mTexture = PLMath::Matrix4x4::Identity |
||
) | [pure virtual] |
Draws an image using a given 3D position.
[in] | cTextureBuffer | Texture buffer holding the image to draw |
[in] | cSamplerStates | Sampler states |
[in] | vPos | Image position |
[in] | mObjectSpaceToClipSpace | Object space to clip space matrix |
[in] | vSize | Image size |
[in] | cColor | Color to use |
[in] | fAlphaReference | Alpha test reference value (0-1), all texels below the value will be discarded, if >= 1, no alpha test will be performed |
[in] | vTextureCoordinate | Normalized texture coordinate (0..1) |
[in] | vTextureCoordinateSize | Normalized texture coordinate size (0..1) |
[in] | mTexture | Texture matrix |
virtual void PLRenderer::DrawHelpers::DrawPoint | ( | const PLGraphics::Color4 & | cColor, |
const PLMath::Vector2 & | vPosition, | ||
float | fSize = 1.0f |
||
) | [pure virtual] |
Draws a single colored point using a given 2D position.
[in] | cColor | Color to use |
[in] | vPosition | 2D point position |
[in] | fSize | Point size |
virtual void PLRenderer::DrawHelpers::DrawPoint | ( | const PLGraphics::Color4 & | cColor, |
const PLMath::Vector3 & | vPosition, | ||
const PLMath::Matrix4x4 & | mObjectSpaceToClipSpace, | ||
float | fSize = 1.0f |
||
) | [pure virtual] |
Draws a single colored point using a given 3D position.
[in] | cColor | Color to use |
[in] | vPosition | 3D object space point position |
[in] | mObjectSpaceToClipSpace | Object space to clip space matrix |
[in] | fSize | Point size |
virtual void PLRenderer::DrawHelpers::DrawLine | ( | const PLGraphics::Color4 & | cColor, |
const PLMath::Vector2 & | vStartPosition, | ||
const PLMath::Vector2 & | vEndPosition, | ||
float | fWidth = 1.0f |
||
) | [pure virtual] |
Draws a single colored line using a given 2D start position and 2D end position.
[in] | cColor | Color to use |
[in] | vStartPosition | 2D start position of the line |
[in] | vEndPosition | 2D end position of the line |
[in] | fWidth | Width of the line |
virtual void PLRenderer::DrawHelpers::DrawLine | ( | const PLGraphics::Color4 & | cColor, |
const PLMath::Vector3 & | vStartPosition, | ||
const PLMath::Vector3 & | vEndPosition, | ||
const PLMath::Matrix4x4 & | mObjectSpaceToClipSpace, | ||
float | fWidth = 1.0f |
||
) | [pure virtual] |
Draws a single colored line using a given 3D start position and 3D end position.
[in] | cColor | Color to use |
[in] | vStartPosition | 3D object space start position of the line |
[in] | vEndPosition | 3D object space end position of the line |
[in] | mObjectSpaceToClipSpace | Object space to clip space matrix |
[in] | fWidth | Width of the line |
virtual void PLRenderer::DrawHelpers::DrawTriangle | ( | const PLGraphics::Color4 & | cColor, |
const PLMath::Vector3 & | vV1, | ||
const PLMath::Vector3 & | vV2, | ||
const PLMath::Vector3 & | vV3, | ||
const PLMath::Matrix4x4 & | mObjectSpaceToClipSpace, | ||
float | fWidth = 0.0f |
||
) | [pure virtual] |
Draws a colored triangle.
[in] | cColor | Color to use |
[in] | vV1 | Object space triangle vertex 1 |
[in] | vV2 | Object space triangle vertex 2 |
[in] | vV3 | Object space triangle vertex 3 |
[in] | mObjectSpaceToClipSpace | Object space to clip space matrix |
[in] | fWidth | Width of the line, if 0, the box is not drawn using lines |
virtual void PLRenderer::DrawHelpers::DrawQuad | ( | const PLGraphics::Color4 & | cColor, |
const PLMath::Vector2 & | vPos, | ||
const PLMath::Vector2 & | vSize, | ||
float | fWidth = 0.0f |
||
) | [pure virtual] |
Draws a colored 2D quad.
[in] | cColor | Color to use |
[in] | vPos | 2D position |
[in] | vSize | 2D size |
[in] | fWidth | Width of the line, if 0, the quad is not drawn using lines |
virtual void PLRenderer::DrawHelpers::DrawQuad | ( | const PLGraphics::Color4 & | cColor, |
const PLMath::Vector3 & | vV1, | ||
const PLMath::Vector3 & | vV2, | ||
const PLMath::Vector3 & | vV3, | ||
const PLMath::Vector3 & | vV4, | ||
const PLMath::Matrix4x4 & | mObjectSpaceToClipSpace, | ||
float | fWidth = 0.0f |
||
) | [pure virtual] |
Draws a colored quad using given 3D positions.
[in] | cColor | Color to use |
[in] | vV1 | Object space quad vertex 1 |
[in] | vV2 | Object space quad vertex 2 |
[in] | vV3 | Object space quad vertex 3 |
[in] | vV4 | Object space quad vertex 4 |
[in] | mObjectSpaceToClipSpace | Object space to clip space matrix |
[in] | fWidth | Width of the line, if 0, the quad is not drawn using lines |
virtual void PLRenderer::DrawHelpers::DrawGradientQuad | ( | const PLGraphics::Color4 & | cColor1, |
const PLGraphics::Color4 & | cColor2, | ||
float | fAngle, | ||
const PLMath::Vector2 & | vPos, | ||
const PLMath::Vector2 & | vSize | ||
) | [pure virtual] |
Draws a gradient colored 2D quad.
[in] | cColor1 | First color to use |
[in] | cColor2 | Second color to use |
[in] | fAngle | Clockwise angle (in radian) of the gradient color. 0° means from left to right. |
[in] | vPos | 2D position |
[in] | vSize | 2D size |
virtual void PLRenderer::DrawHelpers::DrawGradientQuad | ( | const PLGraphics::Color4 & | cColor1, |
const PLGraphics::Color4 & | cColor2, | ||
float | fAngle, | ||
const PLMath::Vector3 & | vV1, | ||
const PLMath::Vector3 & | vV2, | ||
const PLMath::Vector3 & | vV3, | ||
const PLMath::Vector3 & | vV4, | ||
const PLMath::Matrix4x4 & | mObjectSpaceToClipSpace | ||
) | [pure virtual] |
Draws a gradient colored quad using given 3D positions.
[in] | cColor1 | First color to use |
[in] | cColor2 | Second color to use |
[in] | fAngle | Clockwise angle (in radian) of the gradient color. 0° means from left to right. |
[in] | vV1 | Object space quad vertex 1 |
[in] | vV2 | Object space quad vertex 2 |
[in] | vV3 | Object space quad vertex 3 |
[in] | vV4 | Object space quad vertex 4 |
[in] | mObjectSpaceToClipSpace | Object space to clip space matrix |
virtual void PLRenderer::DrawHelpers::DrawBox | ( | const PLGraphics::Color4 & | cColor, |
const PLMath::Vector3 & | vMin, | ||
const PLMath::Vector3 & | vMax, | ||
const PLMath::Matrix4x4 & | mObjectSpaceToClipSpace, | ||
float | fWidth = 0.0f |
||
) | [pure virtual] |
Draws a colored box.
[in] | cColor | Color to use |
[in] | vMin | Minimum object space position |
[in] | vMax | Maximum object space position |
[in] | mObjectSpaceToClipSpace | Object space to clip space matrix |
[in] | fWidth | Width of the line, if 0, the box is not drawn using lines |
virtual void PLRenderer::DrawHelpers::DrawPlane | ( | const PLGraphics::Color4 & | cColor, |
const PLMath::Vector3 & | vN, | ||
float | fD, | ||
const PLMath::Matrix4x4 & | mObjectSpaceToClipSpace, | ||
float | fSize = 10000.0f , |
||
float | fLineWidth = 1.0f |
||
) | [pure virtual] |
Draws a colored plane.
[in] | cColor | Color to use |
[in] | vN | Plane normal (must be normalized) |
[in] | fD | Plane d factor |
[in] | mObjectSpaceToClipSpace | Object space to clip space matrix |
[in] | fSize | Plane size, a plane has an infinite size but often it's useful to limit the visible size... |
[in] | fLineWidth | Width of the line, if 0, draw no line to origin |
|