32 #include "../../Core/Math/mat4.h"
33 #include "../../Core/Math/mat3.h"
34 #include "../../Core/Math/point.h"
35 #include "../../Core/Math/size.h"
36 #include "../../Core/Math/rect.h"
37 #include "../../Core/Math/color.h"
56 static std::shared_ptr<Canvas>
create(
const DisplayWindowPtr &window);
59 virtual const GraphicContextPtr &
gc()
const = 0;
71 virtual float width()
const = 0;
74 virtual float height()
const = 0;
115 virtual void begin() = 0;
120 virtual void end() = 0;
static std::shared_ptr< Canvas > create(const DisplayWindowPtr &window)
Constructs a canvas.
virtual const Mat4f & inverse_transform() const =0
Returns the inverse of the transform matrix.
Top-level window class.
Definition: display_window.h:101
virtual float height() const =0
Returns the current height of the context.
virtual Pointf grid_fit(const Pointf &pos)=0
Snaps the point to the nearest pixel corner.
2D (x,y) point structure - Float
Definition: point.h:68
virtual void begin()=0
Marks the start of a canvas rendering pass.
virtual void set_transform(const Mat4f &matrix)=0
Sets the transform matrix to a new matrix.
virtual const GraphicContextPtr & gc() const =0
Returns the graphic context associated with this canvas.
std::shared_ptr< BlendState > BlendStatePtr
Definition: canvas.h:45
Floating point color description class (for float).
Definition: color.h:630
virtual void set_clip(const Rectf &rect)=0
Set the current clipping rectangle.
std::shared_ptr< DisplayWindow > DisplayWindowPtr
Definition: canvas.h:41
static Colorf black
Definition: color.h:799
virtual const Mat4f & projection() const =0
Returns the current effective projection matrix.
2D Graphics Canvas
Definition: canvas.h:52
virtual Sizef size() const =0
Returns the current size of the context.
virtual float pixel_ratio() const =0
2D (width,height) size structure - Float
Definition: size.h:180
virtual void pop_clip()=0
Pop current clipping rectangle from the stack.
virtual void clear(const Colorf &color=Colorf::black)=0
Clears the whole context using the specified color.
virtual Rectf clip() const =0
Returns the current clipping rectangle.
2D (left,top,right,bottom) rectangle structure - Float
Definition: rect.h:505
virtual void push_clip()=0
virtual void reset_clip()=0
Removes any active clipping rectangle and empties the clip stack.
void mult_transform(const Mat4f &matrix)
Multiplies the passed matrix onto the transform matrix.
Definition: canvas.h:110
virtual const Mat4f & transform() const =0
Returns the transform matrix.
virtual void end()=0
Marks the end of a canvas rendering pass.
std::shared_ptr< GraphicContext > GraphicContextPtr
Definition: d3d_target.h:49
Interface to drawing graphics.
Definition: graphic_context.h:269
std::shared_ptr< Canvas > CanvasPtr
Definition: canvas.h:126
virtual float width() const =0
Returns the current width of the context.
Definition: Application/application.h:35
4D matrix
Definition: mat2.h:47
Definition: graphic_context.h:262