Commit 026bd26e authored by Isaak Lim's avatar Isaak Lim
Browse files

- created a GLError header file under ACG/GL/ that holds all current GL error...

- created a GLError header file under ACG/GL/ that holds all current GL error checking functions and macros
- removed unnecessary code and files
- updated the includes

closes #1763

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@17666 383ad7c9-94d9-4d36-a494-682f7c89f535
parent d7a600bf
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (C) 2001-2009 by Computer Graphics Group, RWTH Aachen *
* Copyright (C) 2001-2011 by Computer Graphics Group, RWTH Aachen *
* www.openflipper.org *
* *
*---------------------------------------------------------------------------*
......@@ -34,57 +34,77 @@
/*===========================================================================*\
* *
* $Revision$ *
* $Author$ *
* $Date$ *
* $Revision: 10745 $ *
* $Author: moebius $ *
* $Date: 2011-01-26 10:23:50 +0100 (Wed, 26 Jan 2011) $ *
* *
\*===========================================================================*/
/*******************************************************************************
* gldebug.h
*
* OpenGL debugging utilities.
*
* (C)2007
* Lehrstuhl I8 RWTH-Aachen, http://www-i8.informatik.rwth-aachen.de
* Author: Markus Tavenrath <speedygoo@speedygoo.de>
*
******************************************************************************/
#ifndef GLDEBUG_H
#define GLDEBUG_H
//=============================================================================
//
// GLError
//
//=============================================================================
//==============================================================================
#include <iostream>
#ifndef ACGGLERROR_H
#define ACGGLERROR_H
//=============================================================================
//
// Includes
//
//=============================================================================
#include <ACG/GL/gl.hh>
#include <ACG/Config/ACGDefines.hh>
//=============================================================================
//
// Macros
//
//=============================================================================
/** \brief
* This file contains two macros for openGL error checking
***/
#ifndef NDEBUG
#define checkGLError() \
{ int error; if ( (error = glGetError()) != GL_NO_ERROR ) std::cout << "GLError " << __FILE__ << ":" << __LINE__ << " - " << error << std::endl; }
#define checkGLError2(str) \
{ int error; if ( (error = glGetError()) != GL_NO_ERROR ) std::cout << "GLError " << __FILE__ << ":" << __LINE__ << " - " << error << " - " << str <<std::endl; }
#else
#else
#define checkGLError()
#define checkGLError2(str)
#endif
//=============================================================================
namespace ACG {
//=============================================================================
//==============================================================================
// Local Variables:
// mode: C++
// c-basic-offset: 4
// indent-tabs-mode: nil
// End:
/** Nice wrapper that outputs all current OpenGL errors to std::cerr.
If no error is present nothing is printed.
**/
inline void glCheckErrors()
{
GLenum error;
while ((error = glGetError()) != GL_NO_ERROR)
{
std::cerr << "GL error: " << gluErrorString(error) << std::endl;
}
}
//==============================================================================
inline void nurbsErrorCallback(GLenum errorCode)
{
const GLubyte *estring;
estring = gluErrorString(errorCode);
std::cerr << "Nurbs Error: " << estring << std::endl;;
}
/* GLDEBUG_H */
#endif
//=============================================================================
} // namespace ACG
//=============================================================================
#endif //ACGGLERROR_H defined
//=============================================================================
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (C) 2001-2011 by Computer Graphics Group, RWTH Aachen *
* www.openflipper.org *
* *
*---------------------------------------------------------------------------*
* This file is part of OpenFlipper. *
* *
* OpenFlipper is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of *
* the License, or (at your option) any later version with the *
* following exceptions: *
* *
* If other files instantiate templates or use macros *
* or inline functions from this file, or you compile this file and *
* link it with other files to produce an executable, this file does *
* not by itself cause the resulting executable to be covered by the *
* GNU Lesser General Public License. This exception does not however *
* invalidate any other reasons why the executable file might be *
* covered by the GNU Lesser General Public License. *
* *
* OpenFlipper is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU LesserGeneral Public *
* License along with OpenFlipper. If not, *
* see <http://www.gnu.org/licenses/>. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $Author$ *
* $Date$ *
* *
\*===========================================================================*/
//=============================================================================
//
// GluError - IMPLEMENTATION
//
//=============================================================================
#include "GluError.hh"
#include <iostream>
void nurbsErrorCallback(GLenum errorCode)
{
const GLubyte *estring;
estring = gluErrorString(errorCode);
std::cerr << "Nurbs Error: " << estring << std::endl;;
};
/*===========================================================================*\
* *
* OpenFlipper *
* Copyright (C) 2001-2011 by Computer Graphics Group, RWTH Aachen *
* www.openflipper.org *
* *
*---------------------------------------------------------------------------*
* This file is part of OpenFlipper. *
* *
* OpenFlipper is free software: you can redistribute it and/or modify *
* it under the terms of the GNU Lesser General Public License as *
* published by the Free Software Foundation, either version 3 of *
* the License, or (at your option) any later version with the *
* following exceptions: *
* *
* If other files instantiate templates or use macros *
* or inline functions from this file, or you compile this file and *
* link it with other files to produce an executable, this file does *
* not by itself cause the resulting executable to be covered by the *
* GNU Lesser General Public License. This exception does not however *
* invalidate any other reasons why the executable file might be *
* covered by the GNU Lesser General Public License. *
* *
* OpenFlipper is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU Lesser General Public License for more details. *
* *
* You should have received a copy of the GNU LesserGeneral Public *
* License along with OpenFlipper. If not, *
* see <http://www.gnu.org/licenses/>. *
* *
\*===========================================================================*/
/*===========================================================================*\
* *
* $Revision$ *
* $Author$ *
* $Date$ *
* *
\*===========================================================================*/
//=============================================================================
//
// GluError
//
//=============================================================================
#ifndef GLUDEBUG_H
#define GLUDEBUG_H
#include <ACG/GL/gl.hh>
#include <ACG/Config/ACGDefines.hh>
void ACGDLLEXPORT nurbsErrorCallback(GLenum errorCode);
#endif
......@@ -53,6 +53,7 @@
#include <ACG/GL/VertexDeclaration.hh>
#include <ACG/GL/GLState.hh>
#include <ACG/GL/GLError.hh>
#include <ACG/Scenegraph/DrawModes.hh>
#include <ACG/Scenegraph/MaterialNode.hh>
......
......@@ -54,6 +54,7 @@
#include "ScreenQuad.hh"
#include <ACG/ShaderUtils/GLSLShader.hh>
#include <ACG/GL/GLError.hh>
//== NAMESPACES ===============================================================
......
......@@ -56,6 +56,7 @@
#include <QTextStream>
#include <ACG/GL/gl.hh>
#include <ACG/GL/GLError.hh>
#include <ACG/ShaderUtils/GLSLShader.hh>
namespace ACG
......
......@@ -296,19 +296,6 @@ inline bool openGLVersion( const int _major, const int _minor ) {
}
/** Nice wrapper that outputs all current OpenGL errors to std::cerr.
If no error is present nothing is printed.
**/
inline void glCheckErrors()
{
GLenum error;
while ((error = glGetError()) != GL_NO_ERROR)
{
std::cerr << "GL error: " << gluErrorString(error) << std::endl;
}
}
//=============================================================================
} // namespace ACG
//=============================================================================
......
......@@ -53,6 +53,7 @@
#include <ACG/Geometry/GPUCacheOptimizer.hh>
#include <ACG/GL/DrawMesh.hh>
#include <ACG/GL/GLError.hh>
//== NAMESPACES ===============================================================
......
......@@ -52,8 +52,8 @@
#include <ACG/GL/gl.hh>
#include <ACG/GL/GLState.hh>
#include <ACG/GL/GLError.hh>
#include "gldebug.h"
#include "GLSLShader.hh"
#include <ACG/GL/ShaderGenerator.hh>
......
......@@ -42,7 +42,7 @@
#include <iostream>
#include "gldebug.h"
#include <ACG/GL/GLError.hh>
#include "UniformPool.hh"
#ifdef WIN32
......
......@@ -54,7 +54,7 @@
#include "BSplineCurveNodeT.hh"
#include <ACG/GL/gl.hh>
#include <ACG/GL/GluError.hh>
#include <ACG/GL/GLError.hh>
#include <ACG/Utils/VSToolsT.hh>
#include <vector>
......
......@@ -54,7 +54,7 @@
#include "BSplineSurfaceNodeT.hh"
#include <ACG/GL/gl.hh>
#include <ACG/GL/GluError.hh>
#include <ACG/GL/GLError.hh>
#include <ACG/Utils/VSToolsT.hh>
#include <vector>
......
......@@ -12,6 +12,7 @@
#include <ACG/ShaderUtils/GLSLShader.hh>
#include <ACG/GL/ShaderCache.hh>
#include <ACG/GL/VertexDeclaration.hh>
#include <ACG/GL/GLError.hh>
using namespace ACG;
......
......@@ -44,6 +44,8 @@
#include <OpenFlipper/common/GlobalOptions.hh>
#include <ObjectTypes/Light/LightNode.hh>
#include <ACG/GL/GLError.hh>
#undef QT_NO_OPENGL
#include <QGLFormat>
#define QT_NO_OPENGL
......
......@@ -44,6 +44,7 @@
#include "SSAO.hh"
#include <OpenFlipper/common/GlobalOptions.hh>
#include <OpenFlipper/BasePlugin/PluginFunctions.hh>
#include <ACG/GL/GLError.hh>
#undef QT_NO_OPENGL
#include <QGLFormat>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment