src/SAL_draw.h

00001 /*
00002     SAL - Simple Application Library
00003     Copyright (C) 2006-2006 Kronon
00004 
00005     This library is free software; you can redistribute it and/or
00006     modify it under the terms of the GNU Lesser General Public
00007     License as published by the Free Software Foundation; either
00008     version 2.1 of the License, or (at your option) any later version.
00009 
00010     This library is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013     Lesser General Public License for more details.
00014 
00015     You should have received a copy of the GNU Lesser General Public
00016     License along with this library; if not, write to the Free Software
00017     Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00018 
00019     Kronon
00020     kronon88@users.sourceforge.net
00021 */
00022 
00023 //SAL draw functionality
00024 //Created by Kronon
00025 
00026 //Doxy gen information
00032 //All draw functions go here for reference
00033 
00034 #ifndef SAL_DRAW_H
00035 #define SAL_DRAW_H
00036         
00037         //Create a new Surface
00038         
00039         #ifndef __SAL_CORE__
00040 
00049                 extern int (*salNewSurface)(int width, int height, SDL_Surface *& surface);
00050                 
00051                 //Draw a rectangle on screen or surface (like button)
00062                 extern int (*salDrawRect)(int x, int y, int width, int height, Uint32 color);
00074                 extern int (*SALDrawRect)(int x, int y, int width, int height, Uint32 color, SDL_Surface * surface);
00085                 extern int (*salFillRect)(int x, int y, int width, int height, Uint32 color);
00097                 extern int (*SALFillRect)(int x, int y, int width, int height, Uint32 color, SDL_Surface * surface);
00098                 //Draw a line one the screen
00109                 extern int (*salDrawLine)(int x1, int y1, int x2, int y2, Uint32 color);
00121                 extern int (*SALDrawLine)(int x1, int y1, int x2, int y2, Uint32 color, SDL_Surface * surface);
00122                 //Draw a text on the screen
00133                 extern int (*salDrawText)(int x, int y, int width, int height, const char* text, Uint32 color);
00147                 extern int (*SALDrawText)(int x, int y, int width, int height, const char* text, Uint32 color, TTF_Font * font, SDL_Surface * surface);
00148                 //Draw an image on the screen
00160                 extern int (*salDrawImage)(int x, int y, int width, int height, SDL_Surface * image);
00175                 extern int (*salDrawCImage)(int x1, int y1, int width1, int height1, int x2, int y2, int width2, int height2, SDL_Surface * image); //Cut and draw
00187                 extern int (*SALDrawImage)(int x, int y, int width, int height, SDL_Surface * image, SDL_Surface * surface);
00203                 extern int (*SALDrawCImage)(int x1, int y1, int width1, int height1, int x2, int y2, int width2, int height2, SDL_Surface * image, SDL_Surface * surface); //Cut and draw
00211                 extern TTF_Font* (*salLoadFont)(const char* url, int size); //Font loading
00217                 extern void (*salClear)(void);
00218         #else
00219                 int (*salNewSurface)(int width, int height, SDL_Surface *& surface);
00220         int (*salDrawRect)(int x, int y, int width, int height, Uint32 color);
00221                 int (*SALDrawRect)(int x, int y, int width, int height, Uint32 color, SDL_Surface * surface);
00222                 int (*salFillRect)(int x, int y, int width, int height, Uint32 color);
00223                 int (*SALFillRect)(int x, int y, int width, int height, Uint32 color, SDL_Surface * surface);
00224                 int (*salDrawLine)(int, int, int, int, Uint32);
00225                 int (*SALDrawLine)(int, int, int, int, Uint32, SDL_Surface * surface);
00226                 int (*salDrawText)(int, int, int, int, const char*, Uint32);
00227                 int (*SALDrawText)(int, int, int, int, const char*, Uint32, TTF_Font *, SDL_Surface * surface);
00228                 int (*salDrawImage)(int, int, int, int, SDL_Surface *);
00229                 int (*salDrawCImage)(int, int, int, int, int, int, int, int, SDL_Surface *);
00230                 int (*SALDrawImage)(int, int, int, int, SDL_Surface *, SDL_Surface *);
00231                 int (*SALDrawCImage)(int, int, int, int, int, int, int, int, SDL_Surface *, SDL_Surface *);
00232                 TTF_Font* (*salLoadFont)(const char* url, int size);
00233                 void (*salClear)(void);
00234         #endif
00235 
00236 #endif