00001 #ifndef SDL_WINDOWMANAGER_H
00002 #define SDL_WINDOWMANAGER_H
00003
00004 #ifdef USE_TILE
00005 #ifdef USE_SDL
00006
00007 #include "windowmanager.h"
00008
00009 struct SDL_Surface;
00010 struct SDL_VideoInfo;
00011
00012 class SDLWrapper : public WindowManager
00013 {
00014 public:
00015 SDLWrapper();
00016 ~SDLWrapper();
00017
00018
00019 virtual int init(coord_def *m_windowsz);
00020
00021
00022 virtual void set_window_title(const char *title);
00023 virtual bool set_window_icon(const char* icon_name);
00024 #ifdef TARGET_OS_WINDOWS
00025 virtual void set_window_placement(coord_def *m_windowsz);
00026 #endif
00027 virtual key_mod get_mod_state() const;
00028 virtual void set_mod_state(key_mod mod);
00029 virtual int byte_order();
00030
00031
00032 virtual void set_timer(unsigned int interval,
00033 wm_timer_callback callback);
00034 virtual unsigned int get_ticks() const;
00035 virtual void delay(unsigned int ms);
00036
00037
00038 virtual int raise_custom_event();
00039 virtual int wait_event(wm_event *event);
00040 virtual unsigned int get_event_count(wm_event_type type);
00041
00042
00043 virtual void resize(coord_def &m_windowsz);
00044 virtual void swap_buffers();
00045 virtual int screen_width() const;
00046 virtual int screen_height() const;
00047 virtual int desktop_width() const;
00048 virtual int desktop_height() const;
00049
00050
00051 virtual bool load_texture(GenericTexture *tex, const char *filename,
00052 MipMapOptions mip_opt, unsigned int &orig_width,
00053 unsigned int &orig_height,
00054 tex_proc_func proc = NULL,
00055 bool force_power_of_two = true);
00056
00057 protected:
00058
00059 SDL_Surface *load_image(const char *file) const;
00060
00061 SDL_Surface *m_context;
00062 const SDL_VideoInfo* video_info;
00063 int _desktop_width;
00064 int _desktop_height;
00065 };
00066
00067 #endif // USE_SDL
00068 #endif // USE_TILE
00069
00070 #endif // SDL_WINDOWMANAGER_H