/* * $Id: output.cc,v 1.3 2002/09/09 23:26:30 stefan Exp $ * Copyright (c) 2002, Dominik Schnitzer * * JFK - JFK Fucking Killerz, a massive multiplayer 2d shoot'em-up game * http://relax.ath.cx/jfk/ * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Library General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "config.h" #include "exception.h" #include "output.h" #include "output_null.h" #include "conffile.h" /* Include the output plugins if available */ #ifdef JFK_OUTPUT_BUILD_SDL #include "output_sdl.h" #endif /* JFK_OUTPUT_BUILD_SDL */ using namespace std; using namespace JFK::client; output::output() { } output::~output() { } output* output_plugins::get_plugin(string id, const conffile& cf) { output* out = NULL; #ifdef JFK_OUTPUT_BUILD_SDL if (id == "sdl") out = new output_sdl(800, 600, 32, cf); #endif /* JFK_OUTPUT_BUILD_SDL */ if (id == "null") out = new output_null(); if (!out) { throw JFK::exception(string("Couldn't load specified video plugin ") + id); } return out; } string output_plugins::list_plugins() { string text = ""; #ifdef JFK_OUTPUT_BUILD_SDL text += " sdl The SDL video driver (default)\n"; #endif /* JFK_OUTPUT_BUILD_SDL */ text += " null The NULL video driver -- you wont see anything :)\n"; return text; } const char* JFK::client::defaultplugin_name() { #ifdef JFK_OUTPUT_BUILD_SDL return "sdl"; #else return "null"; #endif /* JFK_OUTPUT_BUILD_SDL */ }