ff07a3508d15d20f63f0e0a082c15c6d302c7da7
[supertux.git] / src / unison / src / video / sdl / Window.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_SDL_WINDOW_HPP
7 #define UNISON_VIDEO_SDL_WINDOW_HPP
8
9 #include <unison/video/backend/Window.hpp>
10 #include <unison/video/RenderOptions.hpp>
11 #include <string>
12
13 #include "SDL.h"
14
15 namespace Unison
16 {
17    namespace Video
18    {
19       class Texture;
20       namespace SDL
21       {
22          class Window : public Backend::Window
23          {
24             public:
25                Window(const Area &size, const Area &logical_size, bool fullscreen = false);
26
27                ~Window();
28                void take_screenshot(const std::string &filename) const;
29                void flip();
30                void set_title(const std::string &title);
31                void set_icon(const Surface &icon);
32                Area get_size() const;
33                bool is_fullscreen() const;
34                void blit(const Surface &src, const Point &dst_pos, const Rect &src_rect, const RenderOptions &options);
35                void blit(const Video::Texture &src, const Point &dst_pos, const Rect &src_rect, const RenderOptions &options);
36                void fill(const Color &color, const Rect &rect);
37                void fill_blend(const Color &color, const Rect &rect);
38             private:
39                /// The numerator of the scaling ratio
40                unsigned int scale_numerator;
41
42                /// The denominator of the scaling ratio
43                unsigned int scale_denominator;
44
45                /// The offset used to center the drawing area
46                Point offset;
47
48                /// The window
49                SDL_Surface *window;
50          };
51       }
52    }
53 }
54
55 #endif