Initial integration, lots of broken stuff
[supertux.git] / src / unison / src / video / opengl / Texture.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_OPENGL_TEXTURE_HPP
7 #define UNISON_VIDEO_OPENGL_TEXTURE_HPP
8
9 #include <unison/video/backend/Texture.hpp>
10 #include <unison/video/Surface.hpp>
11
12 #include <string>
13 #include <vector>
14
15 #include "SDL.h"
16 #include "SDL_gl.h"
17
18 namespace Unison
19 {
20    namespace Video
21    {
22       namespace OpenGL
23       {
24          class Texture : public Backend::Texture
25          {
26             public:
27                Texture(const Surface &surface);
28                //Texture(const Surface &surface, const std::string &name);
29                //Texture(Backend::Texture *texture);
30                Texture();
31                ~Texture();
32
33                const Surface get_surface();
34                void save();
35                void blit(const Surface &src, const Point &dst_pos, const Rect &src_rect, const RenderOptions &options);
36                void blit(const Video::Texture &src, const Point &dst_pos, const Rect &src_rect, const RenderOptions &options);
37                void fill(const Color &color, const Rect &rect);
38                void fill_blend(const Color &color, const Rect &rect);
39
40                void blit_draw_buffer(const Rect &src_rect, const Point &dst_pos, const RenderOptions &options);
41             private:
42                struct Handle
43                {
44                   GLuint texture;
45                   Rect rect;
46                };
47                std::vector<Handle> handles;
48
49                static Handle create_handle(const Surface &surface, const Rect &rect);
50          };
51       }
52    }
53 }
54
55 #endif