[Refactor] (All): Restructure include system.

This commit is contained in:
BZLZHH
2025-08-09 23:10:34 +08:00
parent a8914c09ce
commit 93ca669929
75 changed files with 3605 additions and 3339 deletions
@@ -1,4 +1,5 @@
#include "../../../Includes.h"
#include "ProgramObject.h"
#include <MG_Util/ShaderTranspiler/ShaderCompiler.h>
namespace MobileGL {
namespace MG_State {
@@ -8,10 +9,8 @@ namespace MobileGL {
}
void ProgramObject::DetachShader(SharedPtr<ShaderObject> shader) {
auto count = std::erase_if(m_shaders,
[shader](const SharedPtr<ShaderObject>& s) {
return s.get() == shader.get();
});
auto count = std::erase_if(
m_shaders, [shader](const SharedPtr<ShaderObject>& s) { return s.get() == shader.get(); });
if (count == 0) {
// FIXME: handle error here
@@ -27,7 +26,7 @@ namespace MobileGL {
shaders[i] = m_shaders[i]->m_shader;
}
MG_Util::ShaderTranspiler::ProgramAttrib attrib {
MG_Util::ShaderTranspiler::ProgramAttrib attrib{
.shaderTypes = Move(shaderTypes),
.shaders = Move(shaders),
};
@@ -40,12 +39,11 @@ namespace MobileGL {
m_linkStatus = false;
m_infoLog = result.error().log;
const std::string e =
std::format("Shader link failed: \nerrc: {}\nmsg: {}\n",
result.error().errc, result.error().log);
const std::string e = std::format("Shader link failed: \nerrc: {}\nmsg: {}\n", result.error().errc,
result.error().log);
THROW_EXCEPTION(e);
}
}
}
}
}
} // namespace GLState
} // namespace MG_State
} // namespace MobileGL