mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-08-15 14:43:32 -07:00
Removes unused ogl_SquelchError
Some checks are pending
Some checks are pending
This commit is contained in:
parent
0a22bc66f7
commit
eb3f55ae27
2 changed files with 0 additions and 55 deletions
|
|
@ -293,46 +293,6 @@ void ogl_WarnIfErrorLoc(const char *file, int line)
|
|||
debug_printf("%s:%d: OpenGL error(s) occurred: %s (%04x)\n", file, line, ogl_GetErrorName(first_error), (unsigned int)first_error);
|
||||
}
|
||||
|
||||
// ignore and reset the specified error (as returned by glGetError).
|
||||
// any other errors that have occurred are reported as ogl_WarnIfError would.
|
||||
//
|
||||
// this is useful for suppressing annoying error messages, e.g.
|
||||
// "invalid enum" for GL_CLAMP_TO_EDGE even though we've already
|
||||
// warned the user that their OpenGL implementation is too old.
|
||||
bool ogl_SquelchError(GLenum err_to_ignore)
|
||||
{
|
||||
// glGetError may return multiple errors, so we poll it in a loop.
|
||||
// the debug_printf should only happen once (if this is set), though.
|
||||
bool error_enountered = false;
|
||||
bool error_ignored = false;
|
||||
GLenum first_error = 0;
|
||||
|
||||
for(;;)
|
||||
{
|
||||
GLenum err = glGetError();
|
||||
if(err == GL_NO_ERROR)
|
||||
break;
|
||||
|
||||
if(err == err_to_ignore)
|
||||
{
|
||||
error_ignored = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if(!error_enountered)
|
||||
first_error = err;
|
||||
|
||||
error_enountered = true;
|
||||
dump_gl_error(err);
|
||||
}
|
||||
|
||||
if(error_enountered)
|
||||
debug_printf("OpenGL error(s) occurred: %04x\n", (unsigned int)first_error);
|
||||
|
||||
return error_ignored;
|
||||
}
|
||||
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// feature and limit detect
|
||||
//----------------------------------------------------------------------------
|
||||
|
|
|
|||
|
|
@ -118,19 +118,4 @@ extern void ogl_WarnIfErrorLoc(const char *file, int line);
|
|||
**/
|
||||
extern const char* ogl_GetErrorName(GLenum err);
|
||||
|
||||
/**
|
||||
* ignore and reset the specified OpenGL error.
|
||||
*
|
||||
* this is useful for suppressing annoying error messages, e.g.
|
||||
* "invalid enum" for GL_CLAMP_TO_EDGE even though we've already
|
||||
* warned the user that their OpenGL implementation is too old.
|
||||
*
|
||||
* call after the fact, i.e. the error has been raised. if another or
|
||||
* different error is pending, those are reported immediately.
|
||||
*
|
||||
* @param err_to_ignore: one of the glGetError enums.
|
||||
* @return true if the requested error was seen and ignored
|
||||
**/
|
||||
extern bool ogl_SquelchError(GLenum err_to_ignore);
|
||||
|
||||
#endif // INCLUDED_OGL
|
||||
|
|
|
|||
Loading…
Reference in a new issue