3 // SuperTux - A Jump'n Run
4 // Copyright (C) 2004 Matthias Braun <matze@braunis.de>
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 #ifndef __DISPLAY_MANAGER_H__
20 #define __DISPLAY_MANAGER_H__
27 // some constants for predefined layer values
29 LAYER_BACKGROUND0 = -300,
30 LAYER_BACKGROUND1 = -200,
31 LAYER_BACKGROUNDTILES = -100,
34 LAYER_FOREGROUNDTILES = 200,
35 LAYER_FOREGROUND0 = 300,
36 LAYER_FOREGROUND1 = 400
39 /** This class holds a list of all things that should be drawn to screen
47 /** adds an object to the list of stuff that should be drawn each frame.
48 * The layer argument specifies how early an object is drawn.
50 void add_drawable(Drawable* object, int layer);
52 void remove_drawable(Drawable* object);
54 void draw(Camera& camera);
57 class DrawingQueueEntry {
59 DrawingQueueEntry(Drawable* newobject, int newlayer)
60 : object(newobject), layer(newlayer)
63 bool operator <(int olayer) const
65 return layer < olayer;
72 typedef std::vector<DrawingQueueEntry> DisplayList;
73 DisplayList displaylist;