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 {
14public:
20 explicit RaylibException(const std::string& message) noexcept : std::runtime_error(message) {
21 // Nothing
22 }
23
29 void TraceLog(int logLevel = LOG_ERROR) { ::TraceLog(logLevel, std::runtime_error::what()); }
30};
31
32} // namespace raylib
33
35
36#endif // RAYLIB_CPP_INCLUDE_RAYLIBEXCEPTION_HPP_
Exception used for most raylib-related exceptions.
void TraceLog(int logLevel=LOG_ERROR)
Outputs the exception message to TraceLog().
RaylibException(const std::string &message) noexcept
Construct a runtime exception with the given message.
All raylib-cpp classes and functions appear in the raylib namespace.
Definition: AudioDevice.hpp:8