Info
Get involved
Documentation
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 console functionality 00024 //Created by Kronon 00025 00026 #ifndef SAL_CONSOLE_H 00027 #define SAL_CONSOLE_H 00028 00029 #include "stdlib.h" 00030 #include "SDL/SDL.h" 00031 #include <iostream> 00032 #include <string> 00033 00034 using namespace std; 00035 00036 //Error messages 00037 void salError(char* error); 00038 00039 template<class freeVal> 00040 void salError(string error, freeVal var1) 00041 { 00042 string message = "SAL error: " + error; message += "\n SDL error: %s\n"; 00043 printf(message.c_str(), var1, SDL_GetError()); 00044 } 00045 00046 template<class freeVal> 00047 void salError(string error, freeVal var1, freeVal var2) 00048 { 00049 string message = "SAL error: " + error; message += "\n SDL error: %s\n"; 00050 printf(message.c_str(), var1, var2, SDL_GetError()); 00051 } 00052 00053 template<class freeVal> 00054 void salError(string error, freeVal var1, freeVal var2, freeVal var3) 00055 { 00056 string message = "SAL error: " + error; message += "\n SDL error: %s\n"; 00057 printf(message.c_str(), var1, var2, var3, SDL_GetError()); 00058 } 00059 00060 template<class freeVal> 00061 void salError(string error, freeVal var1, freeVal var2, freeVal var3, freeVal var4) 00062 { 00063 string message = "SAL error: " + error; message += "\n SDL error: %s\n"; 00064 printf(message.c_str(), var1, var2, var3, var4, SDL_GetError()); 00065 } 00066 00067 //Normal messages 00068 void salPrint(char* message); 00069 00070 template<class freeVal> 00071 void salPrint(string message, freeVal var1) 00072 { 00073 message += "\n"; 00074 printf(message.c_str(), var1); 00075 } 00076 00077 template<class freeVal> 00078 void salPrint(string message, freeVal var1, freeVal var2) 00079 { 00080 message += "\n"; 00081 printf(message.c_str(), var1, var2); 00082 } 00083 00084 template<class freeVal> 00085 void salPrint(string message, freeVal var1, freeVal var2, freeVal var3) 00086 { 00087 message += "\n"; 00088 printf(message.c_str(), var1, var2, var3); 00089 } 00090 00091 template<class freeVal> 00092 void salPrint(string message, freeVal var1, freeVal var2, freeVal var3, freeVal var4) 00093 { 00094 message += "\n"; 00095 printf(message.c_str(), var1, var2, var3, var4); 00096 } 00097 00098 #endif