35 #include "../Render/graphic_context.h" 44 class PrimitivesArray;
58 class DisplayWindowDescription;
379 void fill_triangles(
const std::vector<Vec2f> &positions,
const std::vector<Vec2f> &texture_positions,
const Texture2D &texture,
const std::vector<Colorf> &colors);
423 std::shared_ptr<Canvas_Impl> impl;
const Mat4f & get_projection() const
Returns the current effective projection matrix.
void fill_circle(float center_x, float center_y, float radius, const Colorf &color=Colorf::white)
Draw a circle.
void throw_if_null() const
Throw an exception if this object is invalid.
void draw_lines(const Vec2f *positions, int num_vertices, const Colorf &color=Colorf::white)
Lines.
friend class Font_DrawScaled
Definition: canvas.h:430
Floating point color description class (for float).
Definition: color.h:660
MapMode
Mapping modes.
Definition: canvas.h:64
Rasterizer state setup.
Definition: rasterizer_state.h:44
Sizef get_size() const
Returns the current size of the context.
Definition: canvas.h:127
void pop_cliprect()
Pop current clipping rectangle from the stack.
void fill_rect(float x1, float y1, float x2, float y2, const Colorf &color=Colorf::white)
Draw a filled box / rectangle.
Colorgradient description class.
Definition: gradient.h:41
static Colorf white
Definition: color.h:1251
Frame-buffer object class.
Definition: frame_buffer.h:72
void reset_rasterizer_state()
Set active rasterizer state.
2D Graphics Canvas
Definition: canvas.h:72
void clear(const Colorf &color=Colorf::black)
Clears the whole context using the specified color.
void draw_line_strip(const Vec2f *positions, int num_vertices, const Colorf &color=Colorf::white)
Line Strip.
float get_width() const
Returns the current width of the context.
Definition: canvas.h:121
Pixel data container.
Definition: pixel_buffer.h:68
void mult_transform(const Mat4f &matrix)
Multiplies the passed matrix onto the transform matrix.
float get_dip_width() const
Definition: graphic_context.h:352
float get_pixel_ratio() const
Definition: canvas.h:140
void set_map_mode(MapMode mode)
Set the projection mapping mode.
Blend state setup.
Definition: blend_state.h:44
Triangles - Float.
Definition: triangle_math.h:98
void set_cliprect(const Rectf &rect)
Set the current clipping rectangle.
void clear_stencil(int value=0)
Clear the stencil buffer.
Mat4f & get_inverse_transform()
Returns the inverse of the current effective transform matrix.
friend class Font_DrawSubPixel
Definition: canvas.h:428
friend class Sprite_Impl
Definition: canvas.h:425
Sizef get_dip_size() const
Definition: graphic_context.h:360
Rectf get_cliprect() const
Returns the current clipping rectangle.
Render batching abstraction.
Definition: render_batcher.h:45
void set_depth_stencil_state(const DepthStencilState &state, int stencil_ref=0)
Set active depth stencil state.
void clear_depth(float value=0)
Clear the depth buffer.
void set_projection(const Mat4f &matrix)
Set the projection matrix to be used in user projection map mode.
void draw_box(float x1, float y1, float x2, float y2, const Colorf &color=Colorf::white)
Draw a box / rectangle.
StandardProgram
Standard Program.
Definition: graphic_context.h:239
2D (left,top,right,bottom) rectangle structure - Integer
Definition: rect.h:470
void set_blend_state(const BlendState &state, const Colorf &blend_color=Colorf::white, unsigned int sample_mask=0xffffffff)
Set active blend state.
2D texture object class.
Definition: texture_2d.h:41
void draw_point(float x1, float y1, const Colorf &color)
Draw a point.
float get_pixel_ratio() const
2D (left,top,right,bottom) rectangle structure - Float
Definition: rect.h:484
Canvas create()
Create a copy of a canvas.
PixelBuffer get_pixeldata(const Rect &rect, TextureFormat texture_format=tf_rgba8, bool clamp=true)
Return the content of the read buffer into a pixel buffer.
TextureFormat
Texture format.
Definition: texture_format.h:40
void draw_line(float x1, float y1, float x2, float y2, const Colorf &color=Colorf::white)
Draw a line.
void flush()
Flushes the render batcher currently active.
void push_cliprect()
Push cliprect.
Image class.
Definition: image.h:59
Interface to drawing graphics.
Definition: graphic_context.h:257
void reset_depth_stencil_state()
Set active depth stencil state.
float get_dip_height() const
Definition: graphic_context.h:356
const Mat4f & get_transform() const
Returns the current effective transform matrix.
float get_height() const
Returns the current height of the context.
Definition: canvas.h:124
bool is_null() const
Returns true if this object is invalid.
Definition: canvas.h:97
void set_program_object(StandardProgram standard_program)
Set active program object to the standard program specified.
void set_batcher(RenderBatcher *batcher)
Specifies which render batcher is to be currently active.
DepthStencil state setup.
Definition: depth_stencil_state.h:44
4D matrix
Definition: mat2.h:51
static Colorf black
Definition: color.h:843
2D (x,y) point structure - Float
Definition: point.h:72
void set_transform(const Mat4f &matrix)
Sets the transform matrix to a new matrix.
Top-level window class.
Definition: display_window.h:101
Definition: texture_format.h:43
GraphicContext & get_gc() const
Get gc.
2D line segment - Float
Definition: line_segment.h:210
Canvas()
Constructs a null instance.
void fill_triangle(const Pointf &a, const Pointf &b, const Pointf &c, const Colorf &color=Colorf::white)
Draw a triangle.
void fill_ellipse(const Pointf ¢er, float radius_x, float radius_y, const Colorf &color=Colorf::white)
Draw a filled ellipse.
void fill_triangles(const Vec2f *triangle_positions, int num_vertices, const Colorf &color=Colorf::white)
Draw triangles.
friend class Font_Impl
Definition: canvas.h:427
void reset_cliprect()
Removes the set clipping rectangle and empties the cliprect stack.
friend class Font_DrawFlat
Definition: canvas.h:429
void reset_blend_state()
Set active blend state.
2D (width,height) size structure - Float
Definition: size.h:169
Pointf grid_fit(const Pointf &pos)
Snaps the point to the nearest pixel corner.
void set_rasterizer_state(const RasterizerState &state)
Set active rasterizer state.