From bc61669dadb0e6ce72e90d04995c5cfd8ab3d6bc Mon Sep 17 00:00:00 2001 From: BZLZHH Date: Fri, 20 Jun 2025 23:44:20 +0800 Subject: [PATCH] [Improvement] (All): Remove redundant code. --- .../Implementations/GL/Drawing/GL_Drawing.cpp | 2 +- MG/MG_GL/Implementations/GL/Drawing/GL_Drawing.h | 2 ++ .../Implementations/GL/Program/GL_Program.cpp | 15 --------------- 3 files changed, 3 insertions(+), 16 deletions(-) diff --git a/MG/MG_GL/Implementations/GL/Drawing/GL_Drawing.cpp b/MG/MG_GL/Implementations/GL/Drawing/GL_Drawing.cpp index cc1cef8b..55de58d1 100644 --- a/MG/MG_GL/Implementations/GL/Drawing/GL_Drawing.cpp +++ b/MG/MG_GL/Implementations/GL/Drawing/GL_Drawing.cpp @@ -9,7 +9,7 @@ namespace MG_GL::GL { const FramebufferObject& fbo, MG_Diligent::GLFramebufferInfo& fbInfo); - inline bool IsSamplerType(GLenum type) { + bool IsSamplerType(GLenum type) { switch (type) { case GL_SAMPLER_2D: case GL_SAMPLER_3D: diff --git a/MG/MG_GL/Implementations/GL/Drawing/GL_Drawing.h b/MG/MG_GL/Implementations/GL/Drawing/GL_Drawing.h index 923060cb..f9bb16f3 100644 --- a/MG/MG_GL/Implementations/GL/Drawing/GL_Drawing.h +++ b/MG/MG_GL/Implementations/GL/Drawing/GL_Drawing.h @@ -7,6 +7,8 @@ #include "../../../../Includes.h" namespace MG_GL::GL { + bool IsSamplerType(GLenum type); + void DrawElements(GLenum mode, GLsizei count, GLenum type, const void *indices); void DrawArrays(GLenum mode, GLint first, GLsizei count); void DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLint basevertex); diff --git a/MG/MG_GL/Implementations/GL/Program/GL_Program.cpp b/MG/MG_GL/Implementations/GL/Program/GL_Program.cpp index e861008e..b63b0cac 100644 --- a/MG/MG_GL/Implementations/GL/Program/GL_Program.cpp +++ b/MG/MG_GL/Implementations/GL/Program/GL_Program.cpp @@ -8,21 +8,6 @@ #include "../../../../Includes.h" namespace MG_GL::GL { - inline bool IsSamplerType(GLenum type) { - switch (type) { - case GL_SAMPLER_2D: - case GL_SAMPLER_3D: - case GL_SAMPLER_CUBE: - case GL_SAMPLER_2D_SHADOW: - case GL_SAMPLER_2D_ARRAY: - case GL_SAMPLER_2D_ARRAY_SHADOW: - case GL_SAMPLER_CUBE_SHADOW: - return true; - default: - return false; - } - } - inline size_t GetUniformSize(GLenum type) { switch (type) { case GL_FLOAT: return sizeof(float);