Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/source/graphics/Canvas2D.h
Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Lines | public: | ||||
/** | /** | ||||
* Draws a piece of the texture from the source rect into the | * Draws a piece of the texture from the source rect into the | ||||
* destination rect. The result color is set by the following formula: | * destination rect. The result color is set by the following formula: | ||||
* TEXTURE_COLOR * COLOR_MULTIPLY + COLOR_ADD | * TEXTURE_COLOR * COLOR_MULTIPLY + COLOR_ADD | ||||
* The texture color is blended with its own grayscale version according to | * The texture color is blended with its own grayscale version according to | ||||
* the grayscale factor. | * the grayscale factor. | ||||
*/ | */ | ||||
void DrawTexture(CTexturePtr texture, | void DrawTexture( | ||||
const CRect& destination, const CRect& source, | const CTexturePtr& texture, const CRect& destination, const CRect& source, | ||||
const CColor& multiply, const CColor& add, const float grayscaleFactor); | const CColor& multiply, const CColor& add, const float grayscaleFactor); | ||||
/** | /** | ||||
* A simpler version of the previous one, draws the texture into the | * A simpler version of the previous one, draws the texture into the | ||||
* destination rect without color modifications. | * destination rect without color modifications. | ||||
*/ | */ | ||||
void DrawTexture(CTexturePtr texture, const CRect& destination); | void DrawTexture(const CTexturePtr& texture, const CRect& destination); | ||||
/** | |||||
* A similar to the original one, draws the texture into the | |||||
* destination rect but rotates it first around the origin point by angle | |||||
* radians (a positive angle denotes a clockwise rotation). | |||||
*/ | |||||
void DrawRotatedTexture( | |||||
const CTexturePtr& texture, const CRect& destination, const CRect& source, | |||||
const CColor& multiply, const CColor& add, const float grayscaleFactor, | |||||
const CVector2D& origin, const float angle); | |||||
/** | /** | ||||
* Draws a text using canvas materials. | * Draws a text using canvas materials. | ||||
*/ | */ | ||||
void DrawText(CTextRenderer& textRenderer); | void DrawText(CTextRenderer& textRenderer); | ||||
/** | /** | ||||
* Unbinds all binded resources and clears caches. Frequent calls might | * Unbinds all binded resources and clears caches. Frequent calls might | ||||
Show All 10 Lines |
Wildfire Games · Phabricator