Removes unused ogl_SquelchError
Some checks are pending
checkrefs / lfscheck (push) Waiting to run
checkrefs / checkrefs (push) Waiting to run
lint / cppcheck (push) Waiting to run
lint / copyright (push) Waiting to run
lint / jenkinsfiles (push) Waiting to run
pre-commit / build (push) Waiting to run

This commit is contained in:
Vladislav Belov 2026-07-08 08:13:48 +02:00
parent 0a22bc66f7
commit eb3f55ae27
No known key found for this signature in database
GPG key ID: 353545E45DB9CCB3
2 changed files with 0 additions and 55 deletions

View file

@ -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
//----------------------------------------------------------------------------

View file

@ -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