glc_openglexception.cpp

Go to the documentation of this file.
00001 /****************************************************************************
00002 
00003  This file is part of the GLC-lib library.
00004  Copyright (C) 2005-2008 Laurent Ribon (laumaya@users.sourceforge.net)
00005  http://glc-lib.sourceforge.net
00006 
00007  GLC-lib is free software; you can redistribute it and/or modify
00008  it under the terms of the GNU Lesser General Public License as published by
00009  the Free Software Foundation; either version 3 of the License, or
00010  (at your option) any later version.
00011 
00012  GLC-lib is distributed in the hope that it will be useful,
00013  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  GNU Lesser General Public License for more details.
00016 
00017  You should have received a copy of the GNU Lesser General Public License
00018  along with GLC-lib; if not, write to the Free Software
00019  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00020 
00021 *****************************************************************************/
00022 
00024 
00025 #include "glc_openglexception.h"
00026 
00028 // Constructor destructor
00030 
00031 GLC_OpenGlException::GLC_OpenGlException(const QString& message, GLenum glError)
00032 :GLC_Exception(message)
00033 {
00034         switch (glError)
00035         {
00036                 case GL_INVALID_ENUM :
00037                         m_GlErrorDescription= "GLenum argument out of range";
00038                         break;
00039                 case GL_INVALID_VALUE :
00040                         m_GlErrorDescription= "Numeric argument out of range";
00041                         break;
00042                 case GL_INVALID_OPERATION :
00043                         m_GlErrorDescription= "Operation illegal in current state";
00044                         break;
00045                 case GL_STACK_OVERFLOW :
00046                         m_GlErrorDescription= "Command would cause a stack overflow";
00047                         break;
00048                 case GL_STACK_UNDERFLOW :
00049                         m_GlErrorDescription= "Command would cause a stack underflow";
00050                         break;
00051                 case GL_OUT_OF_MEMORY :
00052                         m_GlErrorDescription= "Not enough memmory left to execute command";
00053                         break;
00054                 default :
00055                         m_GlErrorDescription= "VERY BAD : UNKNOWN ERROR";
00056                         break;
00057                         
00058         }
00059 }
00060 
00061 GLC_OpenGlException::~GLC_OpenGlException() throw()
00062 {
00063         
00064 }
00065 
00066 
00068 // Get Functions
00070 
00071 // Return exception description
00072 const char* GLC_OpenGlException::what() const throw()
00073 {
00074         QString exceptionmsg("GLC_OpenGlException : ");
00075         exceptionmsg.append(m_ErrorDescription);
00076         exceptionmsg.append(m_GlErrorDescription);
00077         return exceptionmsg.toAscii().data();
00078 }

SourceForge.net Logo

©2005-2011 Laurent Ribon