raylib-cpp
C++ object-oriented wrapper library for raylib.
Loading...
Searching...
No Matches
RaylibException.hpp
1#ifndef RAYLIB_CPP_INCLUDE_RAYLIBEXCEPTION_HPP_
2#define RAYLIB_CPP_INCLUDE_RAYLIBEXCEPTION_HPP_
3
4#include <stdexcept>
5#include <string>
6
7#include "./raylib.hpp"
8
9namespace raylib {
13class RaylibException : public std::runtime_error {
14 public:
20 RaylibException(std::string message) throw() : std::runtime_error(message) {
21 // Nothing
22 }
23
29 void TraceLog(int logLevel = LOG_ERROR) {
30 ::TraceLog(logLevel, std::runtime_error::what());
31 }
32};
33
34} // namespace raylib
35
37
38#endif // RAYLIB_CPP_INCLUDE_RAYLIBEXCEPTION_HPP_
Exception used for most raylib-related exceptions.
RaylibException(std::string message)
Construct a runtime exception with the given message.
void TraceLog(int logLevel=LOG_ERROR)
Outputs the exception message to TraceLog().