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;
MapMode
Mapping modes.
Definition: canvas.h:65
C clamp(A val, B minval, C maxval)
Definition: cl_math.h:98
friend class Font_Impl
Definition: canvas.h:427
Sizef get_size() const
Returns the current size of the context.
Definition: canvas.h:127
friend class Font_DrawFlat
Definition: canvas.h:429
void fill_rect(float x1, float y1, float x2, float y2, const Colorf &color=Colorf::white)
Draw a filled box / rectangle.
void reset_blend_state()
Set active blend state.
void fill_triangles(const Vec2f *triangle_positions, int num_vertices, const Texture2D &texture, const Colorf &color=Colorf::white)
Draw triangles.
Pointf grid_fit(const Pointf &pos)
Snaps the point to the nearest pixel corner.
void fill_ellipse(const Pointf ¢er, float radius_x, float radius_y, const Gradient &gradient)
Draw a gradient filled ellipse.
void reset_rasterizer_state()
Set active rasterizer state.
2D line segment - Float
Definition: line_segment.h:211
void throw_if_null() const
Throw an exception if this object is invalid.
void fill_triangles(const std::vector< Vec2f > &positions, const Texture2D &texture, const Rect &texture_rect, const Gradient &gradient)
Draw triangles.
friend class Font_DrawScaled
Definition: canvas.h:430
void fill_rect(float x1, float y1, float x2, float y2, const Gradient &color)
Gradient fill.
float get_width() const
Returns the current width of the context.
Definition: canvas.h:121
void pop_cliprect()
Pop current clipping rectangle from the stack.
void mult_transform(const Mat4f &matrix)
Multiplies the passed matrix onto the transform matrix.
void set_cliprect(const Rectf &rect)
Set the current clipping rectangle.
2D (left,top,right,bottom) rectangle structure - Integer
Definition: rect.h:471
void clear_stencil(int value=0)
Clear the stencil buffer.
void fill_triangle(const Trianglef &dest_triangle, const Colorf &color=Colorf::white)
Draw a triangle.
@ tf_rgba8
Definition: texture_format.h:43
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_dip_width() const
Definition: graphic_context.h:352
float get_pixel_ratio() const
Definition: canvas.h:140
friend class Sprite_Impl
Definition: canvas.h:425
void set_map_mode(MapMode mode)
Set the projection mapping mode.
void fill_circle(const Pointf ¢er, float radius, const Gradient &gradient)
Gradient circle.
Sizef get_dip_size() const
Definition: graphic_context.h:360
void draw_lines(const Vec2f *line_positions, const Vec2f *texture_positions, int num_vertices, const Texture2D &texture, const Colorf &line_color=Colorf::white)
Lines.
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.
2D (x,y) point structure - Float
Definition: point.h:73
void push_cliprect(const Rectf &rect)
Push current clipping rectangle to stack.
2D (left,top,right,bottom) rectangle structure - Float
Definition: rect.h:485
Render batching abstraction.
Definition: render_batcher.h:46
Floating point color description class (for float).
Definition: color.h:661
void set_projection(const Mat4f &matrix)
Set the projection matrix to be used in user projection map mode.
Triangles - Float.
Definition: triangle_math.h:99
friend class Font_DrawSubPixel
Definition: canvas.h:428
Mat4f & get_inverse_transform()
Returns the inverse of the current effective transform matrix.
2D texture object class.
Definition: texture_2d.h:42
void fill_triangles(const std::vector< Vec2f > &positions, const Texture2D &texture, const Rect &texture_rect, const Colorf &color=Colorf::white)
Draw triangles.
void fill_triangles(const Vec2f *triangle_positions, int num_vertices, const Texture2D &texture, const Rect &texture_rect, const Colorf &color=Colorf::white)
Draw triangles.
Rectf get_cliprect() const
Returns the current clipping rectangle.
2D Graphics Canvas
Definition: canvas.h:73
void set_blend_state(const BlendState &state, const Colorf &blend_color=Colorf::white, unsigned int sample_mask=0xffffffff)
Set active blend state.
void fill_rect(const Pointf &start, const Pointf &end, const Colorf &color=Colorf::white)
Fill.
void draw_box(const Rectf &rect, const Colorf &color)
Box.
void draw_point(float x1, float y1, const Colorf &color)
Draw a point.
@ map_2d_upper_left
Definition: canvas.h:66
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:240
void fill_triangles(const Vec2f *triangle_positions, const Colorf *colors, int num_vertices)
Draw triangles.
void fill_triangles(const std::vector< Vec2f > &positions, const std::vector< Vec2f > &texture_positions, const Texture2D &texture, const Colorf &color=Colorf::white)
Draw triangles.
void fill_triangles(const std::vector< Vec2f > &triangles, const Colorf *colors)
Draw triangles.
PixelBuffer get_pixeldata(TextureFormat texture_format=tf_rgba8, bool clamp=true)
Return the content of the read buffer into a pixel buffer.
void fill_rect(const Rectf &rect, const Colorf &color)
Fill.
void fill_triangles(const Vec2f *positions, const Vec2f *texture_positions, int num_vertices, const Texture2D &texture, const Colorf &color=Colorf::white)
Draw triangles.
2D vector
Definition: line.h:48
void fill_rect(const Pointf &start, const Pointf &end, const Gradient &gradient)
Gradient fill.
Interface to drawing graphics.
Definition: graphic_context.h:258
float get_pixel_ratio() const
void fill_triangles(const std::vector< Vec2f > &positions, const Texture2D &texture, const Gradient &gradient)
Draw triangles.
Rasterizer state setup.
Definition: rasterizer_state.h:45
void fill_rect(const Rectf &rect, const Gradient &gradient)
Gradient fill.
void fill_triangles(const std::vector< Vec2f > &positions, const std::vector< Vec2f > &texture_positions, const Texture2D &texture, const std::vector< Colorf > &colors)
Draw triangles.
void flush()
Flushes the render batcher currently active.
void draw_line(const LineSegment2f &line_segment, const Colorf &color=Colorf::white)
Line.
4D matrix
Definition: mat2.h:51
Canvas create()
Create a copy of a canvas.
void draw_point(const Pointf &point, const Colorf &color)
Point.
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.
void fill_triangles(const Vec2f *triangle_positions, int num_vertices, const Gradient &gradient)
Draw triangles.
TextureFormat
Texture format.
Definition: texture_format.h:41
void reset_depth_stencil_state()
Set active depth stencil state.
void fill_triangles(const std::vector< Vec2f > &triangles, const Gradient &gradient)
Draw triangles.
void draw_line(float x1, float y1, float x2, float y2, const Colorf &color=Colorf::white)
Draw a line.
void fill_triangles(const Vec2f *triangle_positions, int num_vertices, const Texture2D &texture, const Gradient &gradient)
Draw triangles.
@ map_user_projection
Definition: canvas.h:68
void fill_triangles(const Vec2f *positions, const Vec2f *texture_positions, int num_vertices, const Texture2D &texture, const Colorf *colors)
Draw triangles.
Frame-buffer object class.
Definition: frame_buffer.h:73
const Mat4f & get_transform() const
Returns the current effective transform matrix.
void push_cliprect()
Push cliprect.
Canvas(DisplayWindow &window)
Constructs a Canvas.
Image class.
Definition: image.h:60
Pixel data container.
Definition: pixel_buffer.h:69
void draw_line(const Pointf &start, const Pointf &end, const Colorf &color=Colorf::white)
Line.
static Colorf black
Definition: color.h:843
float get_dip_height() const
Definition: graphic_context.h:356
void draw_box(const Pointf &start, const Pointf &end, const Colorf &color=Colorf::white)
Box.
void fill_circle(const Pointf ¢er, const Pointf ¢ergradient, float radius, const Gradient &gradient)
Gradient circle.
@ map_2d_lower_left
Definition: canvas.h:67
bool is_null() const
Returns true if this object is invalid.
Definition: canvas.h:97
float get_height() const
Returns the current height of the context.
Definition: canvas.h:124
void fill_triangles(const Vec2f *triangle_positions, int num_vertices, const Texture2D &texture, const Rect &texture_rect, const Gradient &gradient)
Draw triangles.
void set_program_object(StandardProgram standard_program)
Set active program object to the standard program specified.
DepthStencil state setup.
Definition: depth_stencil_state.h:45
Blend state setup.
Definition: blend_state.h:45
void fill_triangles(const std::vector< Vec2f > &triangles, const Colorf &color=Colorf::white)
Draw triangles.
void set_batcher(RenderBatcher *batcher)
Specifies which render batcher is to be currently active.
GraphicContext & get_gc() const
Get gc.
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.
2D (width,height) size structure - Float
Definition: size.h:170
void fill_triangles(const Vec2f *triangle_positions, int num_vertices, const Colorf &color=Colorf::white)
Draw triangles.
void set_transform(const Mat4f &matrix)
Sets the transform matrix to a new matrix.
void fill_circle(const Pointf ¢er, float radius, const Colorf &color=Colorf::white)
Circle.
void reset_cliprect()
Removes the set clipping rectangle and empties the cliprect stack.
Top-level window class.
Definition: display_window.h:102
void fill_triangles(const std::vector< Vec2f > &positions, const Texture2D &texture, const Colorf &color=Colorf::white)
Draw triangles.
Canvas(Canvas &canvas, FrameBuffer &framebuffer)
Constructs a Canvas based on a framebuffer. (based on the copy of the canvas)
void set_rasterizer_state(const RasterizerState &state)
Set active rasterizer state.
const Mat4f & get_projection() const
Returns the current effective projection matrix.
Canvas()
Constructs a null instance.
Colorgradient description class.
Definition: gradient.h:42
void fill_circle(float center_x, float center_y, float radius, const Colorf &color=Colorf::white)
Draw a circle.
static Colorf white
Definition: color.h:1251
void draw_lines(const Vec2f *positions, int num_vertices, const Colorf &color=Colorf::white)
Lines.