summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/base.h5
-rw-r--r--include/engine.h10
-rw-r--r--include/glbase.h4
-rw-r--r--include/texture.h6
4 files changed, 15 insertions, 10 deletions
diff --git a/include/base.h b/include/base.h
index 66e3172..0aecf8c 100644
--- a/include/base.h
+++ b/include/base.h
@@ -3,6 +3,7 @@
#include <SDL.h>
#include <Exceptions.h>
+#include <texture.h>
namespace mogltk {
struct rect {
@@ -14,13 +15,15 @@ namespace mogltk {
virtual ~base();
int GetWidth(void);
int GetHeight(void);
- virtual void Flip(void);
+ virtual void Flip(bool clear = true);
SDL_Surface * getsurface();
virtual void Enter2DMode();
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();
+ virtual texture * GrabTexture();
+ virtual SDL_Surface * GrabSurface();
protected:
base(int, int, int, int);
void setsurface(SDL_Surface *) throw (GeneralException);
diff --git a/include/engine.h b/include/engine.h
index 6a88154..6dbd990 100644
--- a/include/engine.h
+++ b/include/engine.h
@@ -15,20 +15,18 @@ namespace mogltk {
public:
keyevent();
virtual ~keyevent();
- virtual void down(SDL_keysym);
- virtual void up(SDL_keysym);
+ virtual void down(SDL_keysym) = 0;
+ virtual void up(SDL_keysym) = 0;
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);
+ virtual void move(SDL_MouseMotionEvent) = 0;
+ virtual void action(SDL_MouseButtonEvent) = 0;
protected:
- void passdown(SDL_MouseMotionEvent);
mouseevent * old_handler, * new_handler;
};
static int setup() throw(GeneralException);
diff --git a/include/glbase.h b/include/glbase.h
index 7e6d454..9069d69 100644
--- a/include/glbase.h
+++ b/include/glbase.h
@@ -13,7 +13,7 @@ namespace mogltk {
virtual ~glbase();
virtual void Enter2DMode(void);
virtual void Leave2DMode(void);
- virtual void Flip(void);
+ virtual void Flip(bool clear = true);
virtual bool is2D(void);
virtual void changeviewport(int x = 0, int y = 0, unsigned int w = 0, unsigned int h = 0);
void changefovy(GLdouble);
@@ -21,6 +21,8 @@ namespace mogltk {
static void glVertex(GLint, GLint, GLint = 0, GLint = 1);
static void glVertex(GLfloat, GLfloat, GLfloat = 0.0, GLfloat = 1.0);
static void glVertex(GLdouble, GLdouble, GLdouble = 0.0, GLdouble = 1.0);
+ virtual texture * GrabTexture();
+ virtual SDL_Surface * GrabSurface();
private:
int twoD;
GLdouble ratio, fovy;
diff --git a/include/texture.h b/include/texture.h
index 3b60e5b..44e2efe 100644
--- a/include/texture.h
+++ b/include/texture.h
@@ -10,8 +10,9 @@
namespace mogltk {
class texture : public Base {
public:
- texture(int = 256, int = 256, bool = false) throw (GeneralException);
+ texture(int, int, bool = false) throw (GeneralException);
texture(Handle *, bool = false) throw (GeneralException);
+ texture(int, int, int, int);
virtual ~texture();
SDL_Surface * GetSurface();
Uint32 * GetPixels();
@@ -24,11 +25,12 @@ namespace mogltk {
static void Unbind(void);
void Taint(void);
static void Taintall(void);
+ void DumpBMP(const String &);
private:
GLuint width, height, tex;
bool texture_allocated;
SDL_Surface * surface;
- bool planar, tainted;
+ bool planar, tainted, taintable;
static texture * header;
static texture * footer;
texture * next, * prev;