GLC_lib
2.5.0
Main Page
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Users
laumaya
git
glc_lib
src
glc_openglexception.cpp
Go to the documentation of this file.
1
/****************************************************************************
2
3
This file is part of the GLC-lib library.
4
Copyright (C) 2005-2008 Laurent Ribon (laumaya@users.sourceforge.net)
5
http://glc-lib.sourceforge.net
6
7
GLC-lib is free software; you can redistribute it and/or modify
8
it under the terms of the GNU Lesser General Public License as published by
9
the Free Software Foundation; either version 3 of the License, or
10
(at your option) any later version.
11
12
GLC-lib is distributed in the hope that it will be useful,
13
but WITHOUT ANY WARRANTY; without even the implied warranty of
14
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
GNU Lesser General Public License for more details.
16
17
You should have received a copy of the GNU Lesser General Public License
18
along with GLC-lib; if not, write to the Free Software
19
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20
21
*****************************************************************************/
22
24
25
#include "
glc_openglexception.h
"
26
28
// Constructor destructor
30
31
GLC_OpenGlException::GLC_OpenGlException
(
const
QString& message, GLenum glError)
32
:
GLC_Exception
(message)
33
{
34
switch
(glError)
35
{
36
case
GL_INVALID_ENUM :
37
m_GlErrorDescription
=
"GLenum argument out of range"
;
38
break
;
39
case
GL_INVALID_VALUE :
40
m_GlErrorDescription
=
"Numeric argument out of range"
;
41
break
;
42
case
GL_INVALID_OPERATION :
43
m_GlErrorDescription
=
"Operation illegal in current state"
;
44
break
;
45
case
GL_STACK_OVERFLOW :
46
m_GlErrorDescription
=
"Command would cause a stack overflow"
;
47
break
;
48
case
GL_STACK_UNDERFLOW :
49
m_GlErrorDescription
=
"Command would cause a stack underflow"
;
50
break
;
51
case
GL_OUT_OF_MEMORY :
52
m_GlErrorDescription
=
"Not enough memmory left to execute command"
;
53
break
;
54
default
:
55
m_GlErrorDescription
=
"VERY BAD : UNKNOWN ERROR"
;
56
break
;
57
58
}
59
}
60
61
GLC_OpenGlException::~GLC_OpenGlException
() throw()
62
{
63
64
}
65
66
68
// Get Functions
70
71
// Return exception description
72
const
char
*
GLC_OpenGlException::what
()
const
throw()
73
{
74
QString exceptionmsg(
"GLC_OpenGlException : "
);
75
exceptionmsg.append(
m_ErrorDescription
);
76
exceptionmsg.append(
m_GlErrorDescription
);
77
return
exceptionmsg.toLatin1().data();
78
}
©2005-2013 Laurent Ribon