kick
/Users/morten/Programmering/cpp/kick/src/kick/core/debug.h
00001 //
00002 // Created by morten on 15/07/14.
00003 //
00004 
00005 #pragma once
00006 
00007 #include <string>
00008 #include <functional>
00009 #include "glm/glm.hpp"
00010 
00011 #ifdef _WIN32
00012 #define logInfo(x) (kick::Debug::info(x, __FUNCTION__, __FILE__, __LINE__))
00013 #define logWarning(x) (kick::Debug::warning(x, __FUNCTION__, __FILE__, __LINE__))
00014 #define logError(x) (kick::Debug::error(x, __FUNCTION__, __FILE__, __LINE__))
00015 #else
00016 #define logInfo(x) (kick::Debug::info(x, __func__, __FILE__, __LINE__))
00017 #define logWarning(x) (kick::Debug::warning(x, __func__, __FILE__, __LINE__))
00018 #define logError(x) (kick::Debug::error(x, __func__, __FILE__, __LINE__))
00019 #endif 
00020 
00021 namespace kick {
00022     class Camera;
00023 
00024     class Debug {
00025     public:
00026         static std::function<void (std::string message, std::string func, std::string file, int line)> info;
00027         static std::function<void (std::string message, std::string func, std::string file, int line)> warning;
00028         static std::function<void (std::string message, std::string func, std::string file, int line)> error;
00029 
00030         static void drawLine(glm::vec3 from, glm::vec3 to, float seconds, glm::vec4 color = glm::vec4(1.0), Camera* camera = nullptr);
00031         static void drawSphere(glm::vec3 center, float size, float seconds, glm::vec4 color = glm::vec4(1.0), Camera* camera = nullptr);
00032         static void drawBox(glm::vec3 center, glm::vec3 size, float seconds, glm::vec4 color = glm::vec4(1.0), Camera* camera = nullptr);
00033 
00035         static void disable();
00037         static void reset();
00038 
00039         static void printStacktrace();
00040 
00041                 static std::string workingDir();
00042     };
00043 };
00044 
00045 
00046 
 All Classes Functions Variables