X-Git-Url: https://git.ucc.asn.au/?p=progcomp2012.git;a=blobdiff_plain;f=judge%2Fmanager%2Fgraphics.h;h=89a44df1d02456d444e9b543c44cd9f921e483e4;hp=f81bdb3b50329e41f17482a43080e3f9a7c24af0;hb=ac335e7c423d067effae82cc80db518f896271b9;hpb=1a03b2543b67f0551e62babec4cd119f1e0e4640 diff --git a/judge/manager/graphics.h b/judge/manager/graphics.h index f81bdb3..89a44df 100644 --- a/judge/manager/graphics.h +++ b/judge/manager/graphics.h @@ -1,19 +1,27 @@ +#define BUILD_GRAPHICS +#ifdef BUILD_GRAPHICS + #ifndef GRAPHICS_H #define GRAPHICS_H + #include #include +typedef SDL_Surface Screen; +typedef SDL_Rect Rectangle; +typedef short unsigned int SUint; +typedef unsigned char Uint8; #include #include -typedef SDL_Surface Screen; -typedef SDL_Rect Rectangle; + +#include + -typedef short unsigned int SUint; class Texture; class Font; @@ -72,8 +80,8 @@ class Graphics static SDL_Surface * TextureFromColours(std::vector * R, std::vector * G, std::vector * B, std::vector * A = NULL); static SDL_Surface * TextureFromColours(std::vector > * R, std::vector > * G, std::vector > * B, std::vector > * A = NULL); - - static void Wait(int n) {SDL_Delay(n);} + + static void Wait(int n); template class TextureManager @@ -86,7 +94,7 @@ class Graphics }; static bool Initialised() {return initialised;} - + static void ScreenShot(const char * fileName); protected: static void DrawColourData(SDL_Surface * dest, int destX, int destY, std::vector * R, std::vector * G, std::vector * B, std::vector * A = NULL); static void DrawColourData(SDL_Surface * dest, int destX, int destY, std::vector > * R, std::vector > * G, std::vector > * B, std::vector > * A = NULL); @@ -120,6 +128,7 @@ class Texture int width() const {return surface->w;} int height() const {return surface->h;} + protected: SDL_Surface * surface; GLuint texture; @@ -143,6 +152,10 @@ class Font : private Texture }; + + #endif //GRAPHICS_H +#endif //BUILD_GRAPHICS + //EOF