3 #include "ge211_forward.h" 13 namespace exceptions {
29 const char*
what()
const noexcept
override;
38 std::shared_ptr<const std::string> message_;
78 friend detail::Render_sprite;
89 explicit Host_error(
const std::string& extra_message =
"");
100 friend detail::Renderer;
101 friend detail::Render_sprite;
102 friend detail::Texture;
108 explicit File_error(
const std::string& message);
109 static File_error could_not_open(
const std::string& filename);
112 friend detail::File_resource;
118 explicit Font_error(
const std::string& message);
119 static Font_error could_not_load(
const std::string& filename);
129 static Image_error could_not_load(
const std::string& filename);
140 static Mixer_error could_not_load(
const std::string& filename);
166 using Level = Log_level;
168 Level level() const noexcept {
return level_; }
169 void level(Level level) noexcept { level_ = level; }
171 static Logger& instance() noexcept;
174 Logger() noexcept = default;
176 Level level_ = Level::warn;
184 using Level = Log_level;
186 explicit Log_message(Level level = Level::debug);
187 explicit Log_message(std::string reason,
188 Level level = Level::debug) noexcept;
193 if (active_) message_ << value;
198 virtual ~Log_message();
201 Log_message(
const Log_message&) =
delete;
202 Log_message& operator=(
const Log_message&) =
delete;
205 Log_message(Log_message&&) =
default;
206 Log_message& operator=(Log_message&&) =
default;
210 std::ostringstream message_;
214 Log_message debug(std::string reason =
"");
215 Log_message info(std::string reason =
"");
216 Log_message warn(std::string reason =
"");
217 Log_message fatal(std::string reason =
"");
219 Log_message info_sdl();
220 Log_message warn_sdl();
221 Log_message fatal_sdl();
Indicates an error in the mixer, which could include the inability to understand an audio file format...
A Sprite that displays a bitmap image.
Indicates an error loading an image from an already-open file.
The game engine namespace.
A music track, which can be attached to the Mixer and played.
A sound effect track, which can be attached to a Mixer channel and played.
Represents a font that can be used to render a sprites::Text_sprite.
std::ostream & operator<<(std::ostream &os, Mouse_button button)
Prints a Mouse_button on a std::ostream.
Client_logic_error(const std::string &message)
Constructs the error, given the provided error message.
Indicates an exception from the host environment being passed along by ge211.
Indicates a condition unexpected by ge211, that appears to break its invariants.
Provides access to the game window and its properties.
The entity that coordinates playing all audio tracks.
A Sprite that displays text.
An exception that indicates that a logic error was performed by the client.
The root of the ge211 exception hierarchy.
const char * what() const noexcept override
The error message associated with the exception.
Indicates an error loading a font front an already-open file.
Indicates that an error was encountered by the game engine or in the client's environment.
Indicates an error opening a file.