/* * $Id: output_sdl.h,v 1.2 2002/09/09 22:22:11 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. */ #ifndef JFK_OUTPUT_SDL_H #define JFK_OUTPUT_SDL_H #include #include "SDL.h" #include "output.h" #include "conffile.h" using namespace std; namespace JFK { namespace client { /* Implements all necessary GUI functions */ class output_sdl : public output { public: /* Setup the SDL display. */ output_sdl(int width, int height, short bpp, const conffile& c); ~output_sdl(); /* Shows all Data drawn to the offline surface. A surface flip. */ void show(); /* Loads the image specified and returns an cloated SDL Surface */ image load_image(string section, string file, int nr = 0, bool hw = false); /* Frees the memory associated with the given image. */ void free_image(image img); /* Return the Image width */ int get_image_width(image img); /* Return the Image height */ int get_image_height(image img); /* Draws the given object to the given position, ignoring the given * x or y coordinate. */ void draw_image(image img, int x, int y); void draw_image_ext(image img, int sx, int sy, int sw, int sh, int dx, int dy, int dw, int dh); /* Sets the clipping rectangle for a surface. When this surface is the * destination of a blit, only the area within the clip rectangle will * be drawn into. set everything to 0 to disable again. */ void set_cliprect(int x, int y, int w, int h); /* Poll for events. Returns 1 if more events are pending, 0 if finished */ void poll_events(event_t *data); /* Return the current screen height/width */ int get_height() { return screen_height; }; int get_width() { return screen_width; }; private: SDL_Surface* screen; int screen_width, screen_height; short screen_bpp; unsigned int refcount; bool drawn; bool msg_typing; string msg_string; const conffile& cf; }; } } #endif /* JFK_OUTPUT_SDL_H */