The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
exception.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014 - 2016 by Mark de Wever <[email protected]>
3  Part of the Battle for Wesnoth Project http://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 #ifndef SDL_EXCEPTION_HPP_INCLUDED
16 #define SDL_EXCEPTION_HPP_INCLUDED
17 
18 /**
19  * @file
20  * Contains a basic exception class for SDL operations.
21  */
22 
23 #include "exceptions.hpp"
24 
25 namespace sdl
26 {
27 
28 struct texception : public game::error
29 {
30  /**
31  * Constructor.
32  *
33  * @param operation The operation that has failed.
34  * @param use_sdl_error If set to @c true the @p operation is
35  * appended with the SDL error message. Else the
36  * @p operation is the error message for the
37  * exception.
38  */
39  texception(const std::string& operation, const bool use_sdl_error);
40 };
41 
42 #ifdef SDL_GPU
43 struct tgpu_exception : public game::error
44 {
45  tgpu_exception(const std::string &op, const bool fetch_error_msg);
46 };
47 #endif
48 
49 } // namespace sdl
50 
51 #endif
texception(const std::string &operation, const bool use_sdl_error)
Constructor.
Definition: exception.cpp:44
Base class for all the errors encountered by the engine.
Definition: exceptions.hpp:27
GLsizei const GLcharARB ** string
Definition: glew.h:4503