summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/windowmanager-sdl.h
diff options
context:
space:
mode:
authorIxtli <cg@325i.org>2010-04-01 18:10:26 +0900
committerEnne Walker <ennewalker@users.sourceforge.net>2010-04-24 10:19:47 -0400
commitadb9bdd8a87001ff73689b4187581bb077b50df7 (patch)
tree088a2b8d0728f47df9f2be24c1ce5664be0bffb6 /crawl-ref/source/windowmanager-sdl.h
parent8afcc8373d29caa3ead3c4a2e29cbc8adf4cc88f (diff)
downloadcrawl-ref-adb9bdd8a87001ff73689b4187581bb077b50df7.tar.gz
crawl-ref-adb9bdd8a87001ff73689b4187581bb077b50df7.zip
Changed uiwrapper filenames.
Diffstat (limited to 'crawl-ref/source/windowmanager-sdl.h')
-rw-r--r--crawl-ref/source/windowmanager-sdl.h62
1 files changed, 62 insertions, 0 deletions
diff --git a/crawl-ref/source/windowmanager-sdl.h b/crawl-ref/source/windowmanager-sdl.h
new file mode 100644
index 0000000000..abea9d3a8b
--- /dev/null
+++ b/crawl-ref/source/windowmanager-sdl.h
@@ -0,0 +1,62 @@
+#ifndef SDL_WINDOWMANAGER_H
+#define SDL_WINDOWMANAGER_H
+
+#ifdef USE_TILE
+#include "windowmanager.h"
+
+#ifdef USE_SDL
+struct SDL_Surface;
+struct SDL_VideoInfo;
+
+class SDLWrapper : public WindowManager
+{
+public:
+ SDLWrapper();
+
+ // Class functions
+ virtual int init(coord_def *m_windowsz);
+ virtual void shutdown();
+
+ // Environment state functions
+ virtual void set_window_title(const char *title);
+ virtual bool set_window_icon(const char* icon_name);
+ virtual key_mod get_mod_state();
+ virtual void set_mod_state(key_mod mod);
+ virtual int byte_order();
+
+ // System time functions
+ virtual void set_timer( unsigned int interval,
+ ui_timer_callback callback);
+ virtual unsigned int get_ticks();
+ virtual void delay(unsigned int ms);
+
+ // Event functions
+ virtual int raise_custom_event();
+ virtual int wait_event(ui_event *event);
+ virtual unsigned int get_event_count(ui_event_type type);
+
+ // Display functions
+ virtual void resize(coord_def &m_windowsz);
+ virtual void swap_buffers();
+ virtual int screen_width();
+ virtual int screen_height();
+
+ // Texture loading
+ virtual bool load_texture( GenericTexture *tex, const char *filename,
+ MipMapOptions mip_opt, unsigned int &orig_width,
+ unsigned int &orig_height,
+ tex_proc_func proc = NULL,
+ bool force_power_of_two = true);
+
+protected:
+ // Helper functions
+ SDL_Surface *load_image( const char *file ) const;
+
+ SDL_Surface *m_context;
+ const SDL_VideoInfo* video_info;
+};
+
+#endif // USE_SDL
+#endif // USE_TILE
+
+#endif // SDL_WINDOWMANAGER_H