.. index:: pair: class; EE::Graphics::Primitives .. _doxid-class_e_e_1_1_graphics_1_1_primitives: class EE::Graphics::Primitives ============================== .. toctree:: :hidden: Overview ~~~~~~~~ Basic primitives rendering class. :ref:`More...` .. ref-code-block:: cpp :class: doxyrest-overview-code-block #include class Primitives { public: // construction :target:`~Primitives`(); // methods void :ref:`drawPoint`(const :ref:`Vector2f`& p, const :ref:`Float`& pointSize = 1.0f); void :ref:`drawLine`(const :ref:`Line2f`& line); void :ref:`drawArc`(const :ref:`Vector2f`& p, const :ref:`Float`& radius, :ref:`Uint32` segmentsCount = 0, const :ref:`Float`& arcAngle = 360.f, const :ref:`Float`& arcStartAngle = 0.f); void :ref:`drawCircle`(const :ref:`Vector2f`& p, const :ref:`Float`& radius, :ref:`Uint32` segmentsCount = 0); void :ref:`drawTriangle`(const :ref:`Triangle2f`& t); void :ref:`drawTriangle`(const :ref:`Triangle2f`& t, const :ref:`Color`& Color1, const :ref:`Color`& Color2, const :ref:`Color`& Color3); void :ref:`drawRectangle`(const :ref:`Rectf`& R, const :ref:`Float`& Angle, const :ref:`Vector2f`& Scale = Vector2f::One); void :ref:`drawRectangle`(const :ref:`Rectf`& R); void :ref:`drawRoundedRectangle`(const :ref:`Rectf`& R, const :ref:`Float`& Angle = 0, const :ref:`Vector2f`& Scale = Vector2f::One, const unsigned int& Corners = 8); void :ref:`drawRectangle`( const :ref:`Rectf`& R, const :ref:`Color`& TopLeft, const :ref:`Color`& BottomLeft, const :ref:`Color`& BottomRight, const :ref:`Color`& TopRight, const :ref:`Float`& Angle = 0, const :ref:`Vector2f`& Scale = Vector2f::One ); void :ref:`drawRoundedRectangle`( const :ref:`Rectf`& R, const :ref:`Color`& TopLeft, const :ref:`Color`& BottomLeft, const :ref:`Color`& BottomRight, const :ref:`Color`& TopRight, const :ref:`Float`& Angle = 0, const :ref:`Vector2f`& Scale = Vector2f::One, const unsigned int& Corners = 8 ); void :ref:`drawQuad`(const :ref:`Quad2f`& q, const :ref:`Float`& OffsetX = 0, const :ref:`Float`& OffsetY = 0); void :ref:`drawQuad`( const :ref:`Quad2f`& q, const :ref:`Color`& Color1, const :ref:`Color`& Color2, const :ref:`Color`& Color3, const :ref:`Color`& Color4, const :ref:`Float`& OffsetX = 0, const :ref:`Float`& OffsetY = 0 ); void :ref:`drawPolygon`(const :ref:`Polygon2f`& p); void :ref:`setColor`(const :ref:`Color`& Color); const :ref:`Color`& :ref:`getColor`(); void :ref:`setForceDraw`(const bool& force); const bool& :target:`getForceDraw`() const; void :ref:`drawBatch`(); void :ref:`setFillMode`(const :ref:`PrimitiveFillMode`& Mode); const :ref:`PrimitiveFillMode`& :ref:`getFillMode`() const; void :ref:`setBlendMode`(const :ref:`BlendMode`& Mode); const :ref:`BlendMode`& :ref:`getBlendMode`() const; void :ref:`setLineWidth`(const :ref:`Float`& width); const :ref:`Float`& :ref:`getLineWidth`() const; }; .. _details-class_e_e_1_1_graphics_1_1_primitives: Detailed Documentation ~~~~~~~~~~~~~~~~~~~~~~ Basic primitives rendering class. Methods ------- .. index:: pair: function; drawPoint .. _doxid-class_e_e_1_1_graphics_1_1_primitives_1ae2a127d773de9c7851ccc07d6e31c66c: .. ref-code-block:: cpp :class: doxyrest-title-code-block void drawPoint(const :ref:`Vector2f`& p, const :ref:`Float`& pointSize = 1.0f) Draw a point on the screen .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - p - The coordinates * - pointSize - Point Size (default 1.0f ) .. index:: pair: function; drawLine .. _doxid-class_e_e_1_1_graphics_1_1_primitives_1a6eb362b7731b528b0db35af8919e0ee2: .. ref-code-block:: cpp :class: doxyrest-title-code-block void drawLine(const :ref:`Line2f`& line) Draw a Line on screen .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - line - The line .. index:: pair: function; drawArc .. _doxid-class_e_e_1_1_graphics_1_1_primitives_1a5aef818a2579b70383ebe93623593f65: .. ref-code-block:: cpp :class: doxyrest-title-code-block void drawArc(const :ref:`Vector2f`& p, const :ref:`Float`& radius, :ref:`Uint32` segmentsCount = 0, const :ref:`Float`& arcAngle = 360.f, const :ref:`Float`& arcStartAngle = 0.f) Draw an arc on the screen .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - p - The coordinates ( x and y represents the center of the circle ) * - radius - The Circle Radius * - segmentsCount - Number of segments to represent the circle * - arcAngle - The arc angle * - arcStartAngle - The arc starting point angle .. index:: pair: function; drawCircle .. _doxid-class_e_e_1_1_graphics_1_1_primitives_1aae5801e435c47f9d3b5075d199b2e457: .. ref-code-block:: cpp :class: doxyrest-title-code-block void drawCircle(const :ref:`Vector2f`& p, const :ref:`Float`& radius, :ref:`Uint32` segmentsCount = 0) Draw a circle on the screen .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - p - The coordinates ( x and y represents the center of the circle ) * - radius - The Circle Radius * - segmentsCount - Number of segments to represent the circle. If segmentsCount is equal to 0 by default will use an optimized circle rendering ( precached coordinates ). .. index:: pair: function; drawTriangle .. _doxid-class_e_e_1_1_graphics_1_1_primitives_1ac6feec8db83780584a645fa60d51db61: .. ref-code-block:: cpp :class: doxyrest-title-code-block void drawTriangle(const :ref:`Triangle2f`& t) Draw a triangle on the screen .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - t - The Triangle (Triangle2f) .. index:: pair: function; drawTriangle .. _doxid-class_e_e_1_1_graphics_1_1_primitives_1a0502f214dabecee5521bf6391a634b0e: .. ref-code-block:: cpp :class: doxyrest-title-code-block void drawTriangle(const :ref:`Triangle2f`& t, const :ref:`Color`& Color1, const :ref:`Color`& Color2, const :ref:`Color`& Color3) Draw a triangle on the screen setting per vertex color .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - t - The Triangle (Triangle2f) * - Color1 - First Point Color * - Color2 - Second Point Color * - Color3 - Third Point Color .. index:: pair: function; drawRectangle .. _doxid-class_e_e_1_1_graphics_1_1_primitives_1a65630f6b3e8acd85e3d60338f1854365: .. ref-code-block:: cpp :class: doxyrest-title-code-block void drawRectangle(const :ref:`Rectf`& R, const :ref:`Float`& Angle, const :ref:`Vector2f`& Scale = Vector2f::One) Draw a rectangle on the screen .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - R - The Rectangle Rectf * - Angle - Rectangle Angle * - Scale - Rectangle Scale ( default 1.0f ) .. index:: pair: function; drawRectangle .. _doxid-class_e_e_1_1_graphics_1_1_primitives_1a124b838ccc30fd81d9aec30b531adb91: .. ref-code-block:: cpp :class: doxyrest-title-code-block void drawRectangle(const :ref:`Rectf`& R) Draw a rectangle on the screen .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - R - The Rectangle Rectf .. index:: pair: function; drawRoundedRectangle .. _doxid-class_e_e_1_1_graphics_1_1_primitives_1aec9cb082110549fdea88df0f3a80801b: .. ref-code-block:: cpp :class: doxyrest-title-code-block void drawRoundedRectangle(const :ref:`Rectf`& R, const :ref:`Float`& Angle = 0, const :ref:`Vector2f`& Scale = Vector2f::One, const unsigned int& Corners = 8) Draw a rounded rectangle on the screen .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - R - The Rectangle Rectf * - Angle - Rectangle Angle * - Scale - Rectangle Scale ( default 1.0f ) * - Corners - Number of vertices per corner ( how rounded is each corner ) .. index:: pair: function; drawRectangle .. _doxid-class_e_e_1_1_graphics_1_1_primitives_1a8a63373fcaaaa1ad98a77622230c4538: .. ref-code-block:: cpp :class: doxyrest-title-code-block void drawRectangle( const :ref:`Rectf`& R, const :ref:`Color`& TopLeft, const :ref:`Color`& BottomLeft, const :ref:`Color`& BottomRight, const :ref:`Color`& TopRight, const :ref:`Float`& Angle = 0, const :ref:`Vector2f`& Scale = Vector2f::One ) Draw a rectangle on the screen setting per vertex color .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - R - The Rectangle Rectf * - TopLeft - The Top Left Rectangle Color * - BottomLeft - The Bottom Left Rectangle Color * - BottomRight - The Bottom Right Rectangle Color * - TopRight - The Top Right Rectangle Color * - Angle - Rectangle Angle * - Scale - Rectangle Scale ( default 1.0f ) .. index:: pair: function; drawRoundedRectangle .. _doxid-class_e_e_1_1_graphics_1_1_primitives_1af10023ac3cbfa89756930a6d6acbeaf9: .. ref-code-block:: cpp :class: doxyrest-title-code-block void drawRoundedRectangle( const :ref:`Rectf`& R, const :ref:`Color`& TopLeft, const :ref:`Color`& BottomLeft, const :ref:`Color`& BottomRight, const :ref:`Color`& TopRight, const :ref:`Float`& Angle = 0, const :ref:`Vector2f`& Scale = Vector2f::One, const unsigned int& Corners = 8 ) Draw a rounded rectangle on the screen setting per vertex color .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - R - The Rectangle Rectf * - TopLeft - The Top Left Rectangle Color * - BottomLeft - The Bottom Left Rectangle Color * - BottomRight - The Bottom Right Rectangle Color * - TopRight - The Top Right Rectangle Color * - Angle - Rectangle Angle * - Scale - Rectangle Scale ( default 1.0f ) * - Corners - Number of vertices per corner ( how rounded is each corner ) .. index:: pair: function; drawQuad .. _doxid-class_e_e_1_1_graphics_1_1_primitives_1a57beffefc660b76cd1358018d8161a6c: .. ref-code-block:: cpp :class: doxyrest-title-code-block void drawQuad(const :ref:`Quad2f`& q, const :ref:`Float`& OffsetX = 0, const :ref:`Float`& OffsetY = 0) Draw a four edges polygon on screen .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - q - The Quad * - OffsetX - X offset for the quad * - OffsetY - Y offset for the quad .. index:: pair: function; drawQuad .. _doxid-class_e_e_1_1_graphics_1_1_primitives_1a3fe8380a9c6f2d6fd39f33d36131e65e: .. ref-code-block:: cpp :class: doxyrest-title-code-block void drawQuad( const :ref:`Quad2f`& q, const :ref:`Color`& Color1, const :ref:`Color`& Color2, const :ref:`Color`& Color3, const :ref:`Color`& Color4, const :ref:`Float`& OffsetX = 0, const :ref:`Float`& OffsetY = 0 ) Draw a four edges polygon on screen .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - q - The Quad * - Color1 - First Point Color * - Color2 - Second Point Color * - Color3 - Third Point Color * - Color4 - Fourth Point Color * - OffsetX - X offset for the quad * - OffsetY - Y offset for the quad .. index:: pair: function; drawPolygon .. _doxid-class_e_e_1_1_graphics_1_1_primitives_1a6b82166b88fb8d51a6c623c09252417b: .. ref-code-block:: cpp :class: doxyrest-title-code-block void drawPolygon(const :ref:`Polygon2f`& p) Draw a polygon on screen .. rubric:: Parameters: .. list-table:: :widths: 20 80 * - p - The Polygon .. index:: pair: function; setColor .. _doxid-class_e_e_1_1_graphics_1_1_primitives_1a6205866207ef49686b02ccade6c78131: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setColor(const :ref:`Color`& Color) Set the current color for drawing primitives .. index:: pair: function; getColor .. _doxid-class_e_e_1_1_graphics_1_1_primitives_1ade1c28785d5d07188a86c69b635a81d3: .. ref-code-block:: cpp :class: doxyrest-title-code-block const :ref:`Color`& getColor() .. rubric:: Returns: The color used to draw the primitives .. index:: pair: function; setForceDraw .. _doxid-class_e_e_1_1_graphics_1_1_primitives_1a9d07fd1323965157b70ac9c105404eb3: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setForceDraw(const bool& force) Forcing the draw, will force the batch renderer to draw the batched vertexs immediately ( active by default ). .. index:: pair: function; drawBatch .. _doxid-class_e_e_1_1_graphics_1_1_primitives_1abc017ac7125c8ab19ff7b9a4ff60060c: .. ref-code-block:: cpp :class: doxyrest-title-code-block void drawBatch() Force to draw the batched vertexs. .. index:: pair: function; setFillMode .. _doxid-class_e_e_1_1_graphics_1_1_primitives_1a4c0d67ffb5ea3bda38f9d695cb98b43e: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setFillMode(const :ref:`PrimitiveFillMode`& Mode) Set the fill mode used to draw primitives .. index:: pair: function; getFillMode .. _doxid-class_e_e_1_1_graphics_1_1_primitives_1aaead83274d461356b4dab589d8f11acd: .. ref-code-block:: cpp :class: doxyrest-title-code-block const :ref:`PrimitiveFillMode`& getFillMode() const .. rubric:: Returns: The fill mode used to draw primitives .. index:: pair: function; setBlendMode .. _doxid-class_e_e_1_1_graphics_1_1_primitives_1aa94795266afccfac5bc86ea9f80ff354: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setBlendMode(const :ref:`BlendMode`& Mode) Set the blend mode used to draw primitives .. index:: pair: function; getBlendMode .. _doxid-class_e_e_1_1_graphics_1_1_primitives_1ab270b30d5f3b71a23d83c626e04cbc2f: .. ref-code-block:: cpp :class: doxyrest-title-code-block const :ref:`BlendMode`& getBlendMode() const .. rubric:: Returns: The blend mode used to draw primitives .. index:: pair: function; setLineWidth .. _doxid-class_e_e_1_1_graphics_1_1_primitives_1a4804aa9e939bb9caf0b2fce78c6a1ef8: .. ref-code-block:: cpp :class: doxyrest-title-code-block void setLineWidth(const :ref:`Float`& width) Set the line width to draw primitives .. index:: pair: function; getLineWidth .. _doxid-class_e_e_1_1_graphics_1_1_primitives_1a0cd765380fd59814a658ea727437020a: .. ref-code-block:: cpp :class: doxyrest-title-code-block const :ref:`Float`& getLineWidth() const .. rubric:: Returns: The line with to draw primitives