proper blitting without texture attachment added - need to redo and refactor the stuff in pipeline
This commit is contained in:
parent
351d29cd54
commit
075d18b4b8
7 changed files with 153 additions and 97 deletions
|
@ -37,90 +37,88 @@ namespace pw {
|
|||
class debug {
|
||||
public:
|
||||
|
||||
enum level {
|
||||
none, //!< nothing will be logged, even no errors
|
||||
error, //!< only errors will be logged
|
||||
warning, //!< log warnings (non-critical errors)
|
||||
message, //!< log messages (something to note but not an error)
|
||||
notification, //!< log some more information
|
||||
info, //!< log verbose information
|
||||
all = 0xFF //!< log absolutely everything
|
||||
};
|
||||
enum level {
|
||||
none, //!< nothing will be logged, even no errors
|
||||
error, //!< only errors will be logged
|
||||
warning, //!< log warnings (non-critical errors)
|
||||
message, //!< log messages (something to note but not an error)
|
||||
notification, //!< log some more information
|
||||
info, //!< log verbose information
|
||||
all = 0xFF //!< log absolutely everything
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief the streaming interface for the logger
|
||||
*/
|
||||
class stream {
|
||||
public:
|
||||
/**
|
||||
* @brief the streaming interface for the logger
|
||||
*/
|
||||
class stream {
|
||||
public:
|
||||
|
||||
|
||||
stream(debug* log = nullptr);
|
||||
~stream();
|
||||
stream(const stream& other);
|
||||
stream(debug* log = nullptr);
|
||||
~stream();
|
||||
stream(const stream& other);
|
||||
|
||||
|
||||
stream &operator << (const bool &value);
|
||||
stream &operator << (const char *value);
|
||||
stream& operator << (const std::string& value); ///! log a string
|
||||
stream& operator << (const bool &value);
|
||||
stream& operator << (const char *value);
|
||||
stream& operator << (const std::string& value); ///! log a string
|
||||
|
||||
stream& operator << (const float &value); ///! log a float value
|
||||
stream& operator << (const double &value); ///! log a double value
|
||||
stream& operator << (const float &value); ///! log a float value
|
||||
stream& operator << (const double &value); ///! log a double value
|
||||
|
||||
stream& operator << (const int &value); ///! log a int value
|
||||
stream& operator << (const unsigned int &value); ///! log a int value
|
||||
stream& operator << (const int &value); ///! log a int value
|
||||
stream& operator << (const unsigned int &value); ///! log a int value
|
||||
|
||||
stream& operator << (const long &value); ///! log a long value
|
||||
stream& operator << (const unsigned long &value); ///! log a int value
|
||||
stream& operator << (const long &value); ///! log a long value
|
||||
stream& operator << (const unsigned long &value); ///! log a int value
|
||||
|
||||
stream& operator << (const void *value); ///! pointer
|
||||
stream& operator << (const void *value); ///! pointer
|
||||
|
||||
protected:
|
||||
protected:
|
||||
|
||||
debug* _log;
|
||||
std::string _line;
|
||||
};
|
||||
debug* _log;
|
||||
std::string _line;
|
||||
};
|
||||
|
||||
/** sets the logging level */
|
||||
void set_level(level level) {_level = level;}
|
||||
|
||||
/** gets the logging level */
|
||||
level level() const { return _level; }
|
||||
|
||||
/** sets the logging level */
|
||||
void set_level(level level) {_level = level;}
|
||||
/**
|
||||
* @brief get the stream interface of the logger
|
||||
* @return return a temporary object that will write and flush the logger
|
||||
*/
|
||||
static stream s(enum level level = info);
|
||||
|
||||
/** gets the logging level */
|
||||
level level() const { return _level; }
|
||||
inline static stream d() { return s(debug::info); }
|
||||
inline static stream e() { return s(debug::error); }
|
||||
inline static stream w() { return s(debug::warning); }
|
||||
|
||||
/**
|
||||
* @brief get the stream interface of the logger
|
||||
* @return return a temporary object that will write and flush the logger
|
||||
*/
|
||||
static stream s(enum level level = info);
|
||||
/**
|
||||
* @brief returns the instance of the logger
|
||||
* @return
|
||||
*/
|
||||
static debug& get();
|
||||
|
||||
inline static stream d() { return s(debug::info); }
|
||||
inline static stream e() { return s(debug::error); }
|
||||
inline static stream w() { return s(debug::warning); }
|
||||
/**
|
||||
* @brief write a message to the log
|
||||
* @param message string
|
||||
*/
|
||||
void write(const std::string &message);
|
||||
|
||||
/**
|
||||
* @brief returns the instance of the logger
|
||||
* @return
|
||||
*/
|
||||
static debug& get();
|
||||
typedef std::function<void(const char*)> Callback;
|
||||
typedef std::vector<Callback> CallbackList;
|
||||
|
||||
/**
|
||||
* @brief write a message to the log
|
||||
* @param message string
|
||||
*/
|
||||
void write(const std::string &message);
|
||||
|
||||
typedef std::function<void(const char*)> Callback;
|
||||
typedef std::vector<Callback> CallbackList;
|
||||
|
||||
~debug();
|
||||
~debug();
|
||||
|
||||
protected:
|
||||
|
||||
debug();
|
||||
debug();
|
||||
|
||||
CallbackList _callbacks;
|
||||
enum level _level;
|
||||
CallbackList _callbacks;
|
||||
enum level _level;
|
||||
};
|
||||
|
||||
///**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue