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