From e465a280b562cf0ed4ab136e240437f6574189f8 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Thu, 30 Dec 2010 05:04:04 +0100 Subject: old Virtual OSC Controller project exported from SVN working copy unfortunately the repository is long gone, so is its history working and tested for: * POSIX/gcc (Linux, Windows Cygwin, OS/2 EMX) * Open Watcom C (native OS/2 and Windows) --- src/graphics.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/graphics.h (limited to 'src/graphics.h') diff --git a/src/graphics.h b/src/graphics.h new file mode 100644 index 0000000..b40b3ce --- /dev/null +++ b/src/graphics.h @@ -0,0 +1,37 @@ + +#ifndef __GRAPHICS_H +#define __GRAPHICS_H + +#include + +#include "controller.h" +#include "fontface.h" + /* ^ defines FONTWIDTH/FONTHEIGHT */ + +int Graphics_DrawHLine(SDL_Surface *s, Uint16 x, Uint16 y, Uint16 l, Uint32 color); +int Graphics_DrawVLine(SDL_Surface *s, Uint16 x, Uint16 y, Uint16 l, Uint32 color); +int Graphics_DrawRect(SDL_Surface *s, SDL_Rect *rect, Uint32 color); +int Graphics_GradFillRect(SDL_Surface *s, SDL_Rect *rect, Uint16 max, + SDL_Color *top, SDL_Color *bottom, SDL_Color *last); +int Graphics_WriteText(SDL_Surface *s, Uint16 x, Uint16 y, const char *text, + Uint32 color); +int Graphics_printf(SDL_Surface *s, Uint16 x, Uint16 y, Uint32 color, + const char *format, ...); + + +static inline int Graphics_BlankRect(SDL_Surface *s, SDL_Rect *rect); +static inline int Graphics_FillRect(SDL_Surface *s, SDL_Rect *rect, Uint32 color); + +static inline int +Graphics_BlankRect(SDL_Surface *s, SDL_Rect *rect) +{ + return SDL_FillRect(s, rect, display.background); +} + +static inline int +Graphics_FillRect(SDL_Surface *s, SDL_Rect *rect, Uint32 color) +{ + return SDL_FillRect(s, rect, color); +} + +#endif -- cgit v1.2.3