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_DRAWING_REQUEST_HPP
18 #define HEADER_SUPERTUX_VIDEO_DRAWING_REQUEST_HPP
26 #include "math/vector.hpp"
27 #include "video/color.hpp"
28 #include "video/font.hpp"
29 #include "video/glutil.hpp"
33 // some constants for predefined layer values
35 // Image/gradient backgrounds (should cover entire screen)
36 LAYER_BACKGROUND0 = -300,
37 // Particle backgrounds
38 LAYER_BACKGROUND1 = -200,
39 // Tilemap backgrounds
40 LAYER_BACKGROUNDTILES = -100,
45 // Objects that pass through walls
46 LAYER_FLOATINGOBJECTS = 150,
48 LAYER_FOREGROUNDTILES = 200,
50 LAYER_FOREGROUND0 = 300,
52 LAYER_FOREGROUND1 = 400,
53 // Hitpoints, time, coins, etc.
55 // Menus, mouse, console etc.
66 : sfactor(GL_SRC_ALPHA), dfactor(GL_ONE_MINUS_SRC_ALPHA)
69 Blend(GLenum s, GLenum d)
70 : sfactor(s), dfactor(d)
80 SURFACE, SURFACE_PART, TEXT, GRADIENT, FILLRECT, INVERSEELLIPSE, DRAW_LIGHTMAP, GETLIGHT
83 struct DrawingRequestData
85 virtual ~DrawingRequestData()
89 struct SurfaceRequest : public DrawingRequestData
95 const Surface* surface;
98 SurfaceRequest(const SurfaceRequest&) = delete;
99 SurfaceRequest& operator=(const SurfaceRequest&) = delete;
102 struct SurfacePartRequest : public DrawingRequestData
104 SurfacePartRequest() :
110 const Surface* surface;
115 SurfacePartRequest(const SurfacePartRequest&) = delete;
116 SurfacePartRequest& operator=(const SurfacePartRequest&) = delete;
119 struct TextRequest : public DrawingRequestData
129 FontAlignment alignment;
132 TextRequest(const TextRequest&);
133 TextRequest& operator=(const TextRequest&);
136 struct GradientRequest : public DrawingRequestData
149 struct FillRectRequest : public DrawingRequestData
162 struct InverseEllipseRequest : public DrawingRequestData
164 InverseEllipseRequest() :
173 struct DrawingRequest
180 DrawingEffect drawing_effect;
186 DrawingRequestData* request_data;
197 color(1.0f, 1.0f, 1.0f, 1.0f),
201 bool operator<(const DrawingRequest& other) const
203 return layer < other.layer;
207 struct GetLightRequest : public DrawingRequestData
209 GetLightRequest() : color_ptr() {}
214 GetLightRequest(const GetLightRequest&) = delete;
215 GetLightRequest& operator=(const GetLightRequest&) = delete;