argh, clean out copy
[supertux.git] / src / unison / src / video / auto / Renderer.hpp
1 //          Copyright Timothy Goya 2007.
2 // Distributed under the Boost Software License, Version 1.0.
3 //    (See accompanying file LICENSE_1_0.txt or copy at
4 //          http://www.boost.org/LICENSE_1_0.txt)
5
6 #ifndef UNISON_VIDEO_AUTO_RENDERER_HPP
7 #define UNISON_VIDEO_AUTO_RENDERER_HPP
8
9 #include <unison/video/backend/Renderer.hpp>
10
11 #include <string> 
12 #include <vector> 
13
14 namespace Unison
15 {
16    namespace Video
17    {
18       namespace Backend
19       {
20          class Texture;
21          class Window;
22       }
23       namespace Auto
24       {
25          /// Does rendering tasks like blits and color fills using SDL
26          class Renderer : public Backend::Renderer
27          {
28             public:
29                Renderer(const std::vector<Backend::Renderer *> &renderers);
30                ~Renderer();
31
32                void init();
33                void quit();
34
35                std::string get_name();
36                bool is_usable();
37
38                Surface load_surface(const std::string &filename);
39                Surface load_surface(const std::string &filename, const Color &colorkey);
40                void save_surface(const Surface &surface, const std::string &filename);
41
42                void blit(const Surface &src, const Rect &src_rect, Surface &dst, const Point &dst_pos, const RenderOptions &options);
43                void blit(Backend::Texture *src, const Rect &src_rect, Surface &dst, const Point &dst_pos, const RenderOptions &options);
44                void fill(Surface &dst, const Color &color, const Rect &rect);
45                void fill_blend(Surface &dst, const Color &color, const Rect &rect);
46
47                Backend::Window *create_window(const Area &size, const Area &logical_size, bool fullscreen);
48                Backend::Texture *create_texture(const Surface &surface);
49             private:
50                Backend::Renderer *renderer;
51                const std::vector<Backend::Renderer *> &renderers;
52          };
53       }
54    }
55 }
56
57 #endif