18 #ifndef HEADER_SUPERTUX_VIDEO_CANVAS_HPP 19 #define HEADER_SUPERTUX_VIDEO_CANVAS_HPP 26 #include "math/rectf.hpp" 27 #include "math/vector.hpp" 28 #include "video/blend.hpp" 29 #include "video/color.hpp" 30 #include "video/drawing_target.hpp" 31 #include "video/font.hpp" 32 #include "video/font_ptr.hpp" 33 #include "video/gl.hpp" 34 #include "video/gradient.hpp" 35 #include "video/layer.hpp" 36 #include "video/paint_style.hpp" 46 enum Filter { BELOW_LIGHTMAP, ABOVE_LIGHTMAP, ALL };
52 void draw_surface(
const SurfacePtr& surface,
const Vector& position,
int layer);
53 void draw_surface(
const SurfacePtr& surface,
const Vector& position,
float angle,
const Color& color,
const Blend& blend,
55 void draw_surface_part(
const SurfacePtr& surface,
const Rectf& srcrect,
const Rectf& dstrect,
57 void draw_surface_scaled(
const SurfacePtr& surface,
const Rectf& dstrect,
59 void draw_surface_batch(
const SurfacePtr& surface,
60 std::vector<Rectf> srcrects,
61 std::vector<Rectf> dstrects,
64 void draw_surface_batch(
const SurfacePtr& surface,
65 std::vector<Rectf> srcrects,
66 std::vector<Rectf> dstrects,
67 std::vector<float> angles,
70 void draw_text(
const FontPtr& font,
const std::string& text,
71 const Vector& position, FontAlignment alignment,
int layer,
const Color& color =
Color(1.0,1.0,1.0));
74 const Vector& position,
int layer,
const Color& color =
Color(1.0,1.0,1.0));
75 void draw_gradient(
const Color& from,
const Color& to,
int layer,
const GradientDirection& direction,
76 const Rectf& region,
const Blend& blend = Blend());
77 void draw_filled_rect(
const Rectf& rect,
const Color& color,
int layer);
78 void draw_filled_rect(
const Rectf& rect,
const Color& color,
float radius,
int layer);
80 void draw_inverse_ellipse(
const Vector& pos,
const Vector& size,
const Color& color,
int layer);
82 void draw_line(
const Vector& pos1,
const Vector& pos2,
const Color& color,
int layer);
83 void draw_triangle(
const Vector& pos1,
const Vector& pos2,
const Vector& pos3,
const Color& color,
int layer);
86 void get_pixel(
const Vector& position,
const std::shared_ptr<Color>& color_out);
89 void render(
Renderer& renderer, Filter filter);
94 Vector apply_translate(
const Vector& pos)
const;
100 std::vector<DrawingRequest*> m_requests;
Definition: obstack.h:151
Definition: renderer.hpp:30
Definition: drawing_request.hpp:39
Definition: paint_style.hpp:25
void get_pixel(const Vector &position, const std::shared_ptr< Color > &color_out)
on next update, set color to lightmap's color at position
Definition: canvas.cpp:335
Definition: video_system.hpp:37
void draw_center_text(const FontPtr &font, const std::string &text, const Vector &position, int layer, const Color &color=Color(1.0, 1.0, 1.0))
Draw text to the center of the screen.
Definition: canvas.cpp:239
Definition: canvas.hpp:43
This class provides functions for drawing things on screen.
Definition: drawing_context.hpp:42