00001 #ifndef DEBUG_H 00002 #define DEBUG_H 00003 00004 #include "irrlicht.h" 00005 00007 00011 class Debug 00012 { 00013 00014 public: 00017 enum DEBUG_TYPE 00018 { 00020 DBGT_CONSOLE = 0, 00022 DBGT_FILE, 00025 DBGT_CONSOLE_AND_FILE 00026 }; 00027 00034 Debug(irr::IrrlichtDevice* d, irr::c8* fileName, irr::core::rect<irr::s32> position); 00035 00037 ~Debug(); 00038 00041 void log(const irr::core::stringc text); 00042 00045 void log(const irr::core::stringw text); 00046 00051 void log(const irr::core::stringw text, const irr::core::stringw value); 00052 00058 void log(const irr::core::stringc text, const irr::c8* description, const irr::core::stringc value); 00059 00065 void log(const irr::c8* text, const irr::core::stringc description, const irr::c8* value); 00066 00069 void log(const irr::c8* text); 00070 00075 void log(const irr::c8* text, const irr::c8* value); 00076 00082 void log(const irr::c8* text, const irr::c8* description, const irr::c8* value); 00083 00088 void log(const irr::c8* text, const irr::s32 value); 00089 00094 void log(const irr::c8* text, const irr::u32 value); 00095 00101 void log(const irr::c8* text, const irr::u32 description, const irr::u32 value); 00102 00107 void log(const irr::c8* text, const irr::f32 value); 00108 00113 void log(const irr::c8* text, const irr::core::stringw value); 00114 00119 void log(const irr::c8* text, const irr::core::stringc value); 00120 00125 void log(const irr::c8* text, const irr::core::vector3d<irr::f32> vector); 00126 00134 void show(const irr::c8* text); 00135 00144 void show(const irr::c8* text, const irr::u32 value); 00145 00154 void show(const irr::c8* text, const irr::s32 value); 00155 00166 void show(const irr::c8* text, const irr::f32 value, bool cutDecimals = true); 00167 00177 void show(const irr::c8* text, const irr::core::vector3d<irr::f32> vector); 00178 00182 void update(void); 00183 00187 void setOutput(DEBUG_TYPE dbgType); 00188 00189 protected: 00190 00191 private: 00192 void write(const irr::core::stringc text); 00193 00194 irr::gui::IGUIStaticText* dbgScreen; 00195 irr::core::array<irr::core::stringw> dbgElements; 00196 irr::io::IWriteFile* logFile; 00197 irr::IrrlichtDevice* device; 00198 irr::gui::IGUIEnvironment* guienv; 00199 DEBUG_TYPE writeTo; 00200 }; 00201 00202 #endif // DEBUG_H