diff options
author | pixel <pixel> | 2004-06-20 23:51:59 +0000 |
---|---|---|
committer | pixel <pixel> | 2004-06-20 23:51:59 +0000 |
commit | bf452e7f6a3fa0e41964fc8e2c57e1e577cd1682 (patch) | |
tree | da2c9b920514d4f7b853cf92ee4050720261dde6 /include | |
parent | b009a6451b7560ba1e0064303deede287c381963 (diff) |
Put some modifications in the overall. Font to texture doesn't work though.
Diffstat (limited to 'include')
-rw-r--r-- | include/base.h | 4 | ||||
-rw-r--r-- | include/engine.h | 23 | ||||
-rw-r--r-- | include/font.h | 13 | ||||
-rw-r--r-- | include/sprite.h | 2 | ||||
-rw-r--r-- | include/texture.h | 4 |
5 files changed, 43 insertions, 3 deletions
diff --git a/include/base.h b/include/base.h index 2607cf5..66e3172 100644 --- a/include/base.h +++ b/include/base.h @@ -5,6 +5,9 @@ #include <Exceptions.h> namespace mogltk { + struct rect { + int x, y, w, h; + }; class base : public Base { public: base(int w = 640, int h = 480, int flags = 0) throw(GeneralException); @@ -17,6 +20,7 @@ namespace mogltk { virtual void Leave2DMode(); virtual bool is2D(); virtual void changeviewport(int x = 0, int y = 0, unsigned int w = 0, unsigned int h = 0); + void ToggleFullscreen(); protected: base(int, int, int, int); void setsurface(SDL_Surface *) throw (GeneralException); diff --git a/include/engine.h b/include/engine.h index 8634f6a..6a88154 100644 --- a/include/engine.h +++ b/include/engine.h @@ -13,9 +13,24 @@ namespace mogltk { public: class keyevent : public Base { public: + keyevent(); + virtual ~keyevent(); virtual void down(SDL_keysym); virtual void up(SDL_keysym); + protected: + void passdown(SDL_keysym); + keyevent * old_handler, * new_handler; }; + class mouseevent : public Base { + public: + mouseevent(); + virtual ~mouseevent(); + virtual void move(SDL_MouseMotionEvent); + virtual void action(SDL_MouseButtonEvent); + protected: + void passdown(SDL_MouseMotionEvent); + mouseevent * old_handler, * new_handler; + }; static int setup() throw(GeneralException); static int postsetup() throw(GeneralException); static int GetInited(); @@ -25,15 +40,22 @@ namespace mogltk { static bool getappactive(); static void setcursorvisible(bool); static bool getcursorvisible(); + static void quit(); static bool quitrequested(); static int mouseX(); static int mouseY(); static int mouseZ(); + static void setmouseX(int); + static void setmouseY(int); + static void setmouseZ(int); static int mousebuttons(); static double FPS(); static void lockmouse(); static void unlockmouse(); static void setkeyevent(keyevent *); + static void setmouseevent(mouseevent *); + static keyevent * getkeyevent(); + static mouseevent * getmouseevent(); static glbase * glbase_o; static base * base_o; static widget * root; @@ -52,6 +74,7 @@ namespace mogltk { static Uint32 curticks; static int locked; static keyevent * keyevent_h; + static mouseevent * mouseevent_h; static void updatemouse(); }; }; diff --git a/include/font.h b/include/font.h index a557f6e..07f7c03 100644 --- a/include/font.h +++ b/include/font.h @@ -7,6 +7,7 @@ #include <Handle.h> #include <texture.h> #include <mcolor.h> +#include <base.h> namespace mogltk { class font : public Base { @@ -14,13 +15,25 @@ namespace mogltk { font(Handle *); virtual ~font(); virtual void drawentry(Uint16, int, int, ColorP = WHITE); + void drawtotex(texture *, Uint16, int, int, ColorP = WHITE); void putcursor(int, int); void putentry(Uint16, ColorP = WHITE); + void putentryontex(texture *, Uint16, ColorP = WHITE); void drawchar(char, ColorP = WHITE); + void drawcharontex(texture *, char, ColorP = WHITE); void newline(void); int printf(const ugly_string &, ...); int printf(const char *, ...); int printf(const ugly_string &, va_list); + rect size(const ugly_string &, ...); + rect size(const char *, ...); + rect size(const ugly_string &, va_list); + rect printtotex(texture *, const ugly_string &, ...); + rect printtotex(texture *, const char *, ...); + rect printtotex(texture *, const ugly_string &, va_list); + texture * printtex(rect *, const ugly_string &, ...); + texture * printtex(rect *, const char *, ...); + texture * printtex(rect *, const ugly_string &, va_list); void setcolor(ColorP); void setshadow(int); void setwspace(int); diff --git a/include/sprite.h b/include/sprite.h index b4ef54a..d328dba 100644 --- a/include/sprite.h +++ b/include/sprite.h @@ -10,7 +10,7 @@ namespace mogltk { class Sprite : public Base { public: - Sprite(Handle *, int, int); + Sprite(Handle *, int, int) throw (GeneralException); Sprite(Uint8 *, int, int); virtual ~Sprite(); virtual void draw(int, int, ColorP = WHITE, float = 1.0, float = 1.0); diff --git a/include/texture.h b/include/texture.h index b558694..3b60e5b 100644 --- a/include/texture.h +++ b/include/texture.h @@ -23,17 +23,17 @@ namespace mogltk { GLuint GetHeight(); static void Unbind(void); void Taint(void); + static void Taintall(void); private: GLuint width, height, tex; bool texture_allocated; SDL_Surface * surface; bool planar, tainted; -#ifdef TRACE_TEXTURES static texture * header; static texture * footer; texture * next, * prev; -#endif static texture * active; + void recTaint(void); }; }; |