|
SDLGameEngine
|
00001 #ifndef _SGEGFX_H 00002 #define _SGEGFX_H 00003 00004 #ifdef __cplusplus 00005 extern "C" { 00006 #endif 00007 00012 /* 00013 * Copyright (c) 2007 Heiko Irrgang 00014 * 00015 * The license and distribution terms for this file may be 00016 * found in the file COPYING in this distribution or at 00017 * http://93-interactive.com/cms/products/software/sdl-game-engine/license/ 00018 */ 00019 00030 #define sgeClearScreen() SDL_FillRect(screen, NULL, 0) 00031 00037 typedef struct { 00039 Uint8 r; 00041 Uint8 g; 00043 Uint8 b; 00045 Uint8 a; 00046 } SGEPIXELINFO; 00047 00053 typedef struct { 00055 int x; 00057 int y; 00058 } SGEPOSITION; 00059 00066 SGEPOSITION *sgePositionNew(int x, int y); 00067 00072 void sgePositionDestroy(SGEPOSITION *p); 00073 00082 SGEPIXELINFO *sgePixelInfoNew(Uint8 r, Uint8 g, Uint8 b, Uint8 a); 00083 00088 void sgePixelInfoDestroy(SGEPIXELINFO *i); 00089 00104 Uint32 sgeMakeColor(SDL_Surface *surface, int r, int g, int b, int a); 00105 00115 void sgeFillRect(SDL_Surface *dest, int x, int y, int w, int h, Uint32 color); 00116 00133 void sgeDrawRect(SDL_Surface *dest, int x, int y, int w, int h, int linewidth, Uint32 color); 00134 00142 void sgeDrawPixel(SDL_Surface *dest, int x, int y, Uint32 color); 00143 00151 SGEPIXELINFO *sgeGetPixel(SDL_Surface *dest, int x, int y); 00152 00162 void sgeDrawLine(SDL_Surface *dest, int x, int y, int x2, int y2, Uint32 color); 00163 00177 void sgeDrawImage(SDL_Surface *dest, SDL_Surface *image, int x, int y); 00178 00183 void sgeIgnoreAlpha(SDL_Surface *s); 00184 00189 void sgeUseAlpha(SDL_Surface *s); 00190 00209 SDL_Surface *sgeRotoZoom(SDL_Surface *source, float rotation, float zoom); 00210 00217 SDL_Surface *sgeChangeSDLSurfaceAlpha(SDL_Surface *s, Uint8 alpha); 00218 00226 SDL_Surface *sgeCreateSDLSurface(int width, int height, int depth, Uint32 sdlflags); 00227 00237 SDL_Surface *sgeCreateVideoSurface(int width, int height, int depth, Uint32 sdlflags); 00238 00243 #define sgeConvertToGray sgeConvertToGrey 00244 00250 SDL_Surface *sgeConvertToGrey(SDL_Surface *src); 00251 00252 // }@ 00253 00254 #ifdef __cplusplus 00255 } 00256 #endif 00257 00258 #endif