Path: blob/master/libmupen64plus/mupen64plus-video-rice/src/OGLDebug.h
2 views
/* OGLDebug.h1Copyright (C) 2009 Richard Goedeken23This program is free software; you can redistribute it and/or4modify it under the terms of the GNU General Public License5as published by the Free Software Foundation; either version 26of the License, or (at your option) any later version.78This program is distributed in the hope that it will be useful,9but WITHOUT ANY WARRANTY; without even the implied warranty of10MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the11GNU General Public License for more details.1213You should have received a copy of the GNU General Public License14along with this program; if not, write to the Free Software15Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.16*/1718#if !defined(OPENGL_DEBUG_H)19#define OPENGL_DEBUG_H2021#if defined(OPENGL_DEBUG)22#define OPENGL_CHECK_ERRORS { const GLenum errcode = glGetError(); if (errcode != GL_NO_ERROR) fprintf(stderr, "OpenGL Error code %i in '%s' line %i\n", errcode, __FILE__, __LINE__-1); }23#else24#define OPENGL_CHECK_ERRORS25#endif2627/* Dump client state (for informational purposes)28int rval = 0;29void *ptr;30glGetIntegerv(GL_ARRAY_BUFFER_BINDING, &rval);31printf("GL_ARRAY_BUFFER_BINDING: %i\n", rval);32glGetPointerv(GL_COLOR_ARRAY_POINTER, &ptr);33printf("GL_COLOR_ARRAY: %i (%lx)\n", (int) glIsEnabled(GL_COLOR_ARRAY), (int) ptr);34glGetPointerv(GL_FOG_COORD_ARRAY_POINTER, &ptr);35printf("GL_FOG_COORDINATE_ARRAY_EXT: %i (%lx)\n", (int) glIsEnabled(GL_FOG_COORDINATE_ARRAY_EXT), (int) ptr);36glGetPointerv(GL_INDEX_ARRAY_POINTER, &ptr);37printf("GL_INDEX_ARRAY: %i (%lx)\n", (int) glIsEnabled(GL_INDEX_ARRAY), (int) ptr);38glGetPointerv(GL_NORMAL_ARRAY_POINTER, &ptr);39printf("GL_NORMAL_ARRAY: %i (%lx)\n", (int) glIsEnabled(GL_NORMAL_ARRAY), (int) ptr);40glGetPointerv(GL_SECONDARY_COLOR_ARRAY_POINTER, &ptr);41printf("GL_SECONDARY_COLOR_ARRAY: %i (%lx)\n", (int) glIsEnabled(GL_SECONDARY_COLOR_ARRAY), (int) ptr);42glGetPointerv(GL_TEXTURE_COORD_ARRAY_POINTER, &ptr);43printf("GL_TEXTURE_COORD_ARRAY: %i (%lx)\n", (int) glIsEnabled(GL_TEXTURE_COORD_ARRAY), (int) ptr);44glGetPointerv(GL_VERTEX_ARRAY_POINTER, &ptr);45printf("GL_VERTEX_ARRAY: %i (%lx)\n", (int) glIsEnabled(GL_VERTEX_ARRAY), (int) ptr);46*/4748#endif /* OPENGL_DEBUG_H */495051