GteOpenGLHelper.cpp
Go to the documentation of this file.
1 // David Eberly, Geometric Tools, Redmond WA 98052
2 // Copyright (c) 1998-2017
3 // Distributed under the Boost Software License, Version 1.0.
4 // http://www.boost.org/LICENSE_1_0.txt
5 // http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt
6 // File Version: 3.0.0 (2016/06/19)
7 
8 #include <GTEnginePCH.h>
9 #include <LowLevel/GteLogger.h>
11 
12 
13 void OpenGLReportListener(char const* glFunction, GLenum code)
14 {
15  std::string strFunction(glFunction);
16  if (code != GL_ZERO)
17  {
18  std::string strCode;
19  switch (code)
20  {
21  case GL_INVALID_ENUM:
22  strCode = "GL_INVALID_ENUM";
23  break;
24  case GL_INVALID_VALUE:
25  strCode = "GL_INVALID_VALUE";
26  break;
28  strCode = "GL_INVALID_OPERATION";
29  break;
30  case GL_STACK_OVERFLOW:
31  strCode = "GL_STACK_OVERFLOW";
32  break;
33  case GL_STACK_UNDERFLOW:
34  strCode = "GL_STACK_UNDERFLOW";
35  break;
36  case GL_OUT_OF_MEMORY:
37  strCode = "GL_OUT_OF_MEMORY";
38  break;
40  strCode = "GL_INVALID_FRAMEBUFFER_OPERATION";
41  break;
42  case GL_CONTEXT_LOST:
43  strCode = "GL_CONTEXT_LOST";
44  break;
45  default:
46  strCode = "unknown error";
47  break;
48  }
49  LogWarning("GL error <" + strCode + "> in " + strFunction);
50  }
51  else
52  {
53  LogError("GL function " + strFunction + " is null.");
54  }
55 }
56 
#define GL_ZERO
Definition: glcorearb.h:217
#define GL_STACK_OVERFLOW
Definition: glcorearb.h:331
void OpenGLReportListener(char const *glFunction, GLenum code)
#define GL_INVALID_FRAMEBUFFER_OPERATION
Definition: glcorearb.h:1105
#define GL_INVALID_VALUE
Definition: glcorearb.h:240
unsigned int GLenum
Definition: glcorearb.h:83
GLsizei const GLchar *const * string
Definition: glcorearb.h:809
#define LogError(message)
Definition: GteLogger.h:92
#define GL_STACK_UNDERFLOW
Definition: glcorearb.h:332
#define GL_INVALID_OPERATION
Definition: glcorearb.h:241
#define LogWarning(message)
Definition: GteLogger.h:95
#define GL_CONTEXT_LOST
Definition: glcorearb.h:2636
#define GL_INVALID_ENUM
Definition: glcorearb.h:239
#define GL_OUT_OF_MEMORY
Definition: glcorearb.h:242


geometric_tools_engine
Author(s): Yijiang Huang
autogenerated on Thu Jul 18 2019 04:00:01