]> git.tdb.fi Git - libs/gl.git/blob - source/glsl/glsl_error.h
Follow the GLSL syntax rules more closely
[libs/gl.git] / source / glsl / glsl_error.h
1 #ifndef MSP_GL_SL_ERROR_H_
2 #define MSP_GL_SL_ERROR_H_
3
4 #include <stdexcept>
5 #include <msp/strings/format.h>
6
7 namespace Msp {
8 namespace GL {
9 namespace SL {
10
11 struct Location;
12
13 class invalid_shader_source: public std::runtime_error
14 {
15 public:
16         invalid_shader_source(const Location &, const std::string &);
17 #if __cplusplus>=201103L
18         template<typename... Args>
19         invalid_shader_source(const Location &loc, const std::string & fmt, Args... args):
20                 invalid_shader_source(loc, format(fmt, args...))
21         { }
22 #endif
23         virtual ~invalid_shader_source() throw() { }
24 };
25
26 class syntax_error: public invalid_shader_source
27 {
28 public:
29         syntax_error(const Location &, const std::string &, const std::string &);
30         virtual ~syntax_error() throw() { }
31 };
32
33 class parse_error: public invalid_shader_source
34 {
35 public:
36         parse_error(const Location &, const std::string &, const std::string &);
37         virtual ~parse_error() throw() { }
38 };
39
40 } // namespace SL
41 } // namespace GL
42 } // namespace Msp
43
44 #endif