2 // Copyright (C) 2006 Matthias Braun <matze@braunis.de>
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 #ifndef HEADER_SUPERTUX_VIDEO_SURFACE_HPP
18 #define HEADER_SUPERTUX_VIDEO_SURFACE_HPP
22 #include "math/vector.hpp"
27 * A rectangular image.
28 * The class basically holds a reference to a texture with additional UV
29 * coordinates that specify a rectangular area on this texture
43 Surface(const std::string& file);
44 Surface(const std::string& file, int x, int y, int w, int h);
45 Surface(const Surface& other);
48 const Surface& operator= (const Surface& other);
50 /** flip the surface horizontally */
52 bool get_flipx() const;
54 Texture *get_texture() const;
55 void *get_surface_data() const;
58 int get_width() const;
59 int get_height() const;
60 Vector get_position() const;
62 * returns a vector containing width and height
64 Vector get_size() const;