1 // $Id: video_systems.cpp 5063 2007-05-27 11:32:00Z matzeb $
4 // Copyright (C) 2006 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.
21 #include "video_systems.hpp"
22 #include "gameconfig.hpp"
23 #include "renderer.hpp"
24 #include "gl_renderer.hpp"
25 #include "sdl_renderer.hpp"
26 #include "lightmap.hpp"
27 #include "gl_lightmap.hpp"
28 #include "sdl_lightmap.hpp"
29 #include "texture.hpp"
30 #include "gl_texture.hpp"
31 #include "sdl_texture.hpp"
32 #include "gl_surface_data.hpp"
33 #include "sdl_surface_data.hpp"
35 Renderer *new_renderer()
41 return new GL::Renderer();
44 return new SDL::Renderer();
46 assert(0 && "invalid video system in config");
47 return new SDL::Renderer();
51 Lightmap *new_lightmap()
57 return new GL::Lightmap();
60 return new SDL::Lightmap();
62 assert(0 && "invalid video system in config");
63 return new SDL::Lightmap();
67 Texture *new_texture(SDL_Surface *image)
73 return new GL::Texture(image);
76 return new SDL::Texture(image);
78 assert(0 && "invalid video system in config");
79 return new SDL::Texture(image);
83 void *new_surface_data(const Surface &surface)
89 return new GL::SurfaceData(surface);
92 return new SDL::SurfaceData(surface);
94 assert(0 && "invalid video system in config");
95 return new SDL::SurfaceData(surface);
99 void free_surface_data(void *surface_data)
101 delete reinterpret_cast<char *>(surface_data);
104 VideoSystem get_video_system(const std::string &video)
108 else if(video == "opengl")
113 else if(video == "sdl")
127 std::string get_video_string(VideoSystem video)
136 assert(0 && "invalid video system in config");