mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-09 04:38:30 +09:00
[Chore] (MG_Backend/DirectGLES): rearrange DebugImpl
This commit is contained in:
@@ -30,24 +30,21 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
||||
}
|
||||
|
||||
namespace DebugImpl {
|
||||
void ErrorLopper::Loop(std::function<void(GLenum)> func) {
|
||||
#if MOBILEGL_LOG_ACTIVE_LEVEL <= MOBILEGL_LOG_LEVEL_DEBUG
|
||||
void ErrorLopper::Loop(std::function<void(GLenum)> func) {
|
||||
GLenum err = MG_External::GLES::glGetError();
|
||||
while (err != GL_NO_ERROR) {
|
||||
func(err);
|
||||
err = MG_External::GLES::glGetError();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
void ErrorLopper::Clear() {
|
||||
#if MOBILEGL_LOG_ACTIVE_LEVEL <= MOBILEGL_LOG_LEVEL_DEBUG
|
||||
GLenum err = MG_External::GLES::glGetError();
|
||||
while (err != GL_NO_ERROR) {
|
||||
MGLOG_D("Stray GL Error cleared: %s", MG_Util::ConvertGLEnumToString(err).c_str());
|
||||
err = MG_External::GLES::glGetError();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
ErrorLopper::ErrorLopper() {
|
||||
@@ -56,6 +53,12 @@ namespace MobileGL::MG_Backend::DirectGLES {
|
||||
ErrorLopper::~ErrorLopper() {
|
||||
Clear();
|
||||
}
|
||||
#else
|
||||
void ErrorLopper::Loop(std::function<void(GLenum)> func) {}
|
||||
void ErrorLopper::Clear() {}
|
||||
ErrorLopper::ErrorLopper() {}
|
||||
ErrorLopper::~ErrorLopper() {}
|
||||
#endif
|
||||
} // namespace DebugImpl
|
||||
|
||||
// TODO: deletion for deleted objects
|
||||
|
||||
Reference in New Issue
Block a user