From 04976daa9f6fcabb8b54c00d71b0b1cdfdb01e54 Mon Sep 17 00:00:00 2001 From: BZLZHH Date: Thu, 1 May 2025 09:22:50 +0800 Subject: [PATCH] [Refactor] (...): Optimize code file structure. --- CMakeLists.txt | 47 +++++++++---------- MG/Global.h | 2 +- MG/Includes.h | 28 +++++------ MG/MG_GL/BackendLoader/GLES/Loader.cpp | 1 + MG/MG_GL/GL_Def/GL_Def.h | 10 ---- .../EGL/GLES/EGL_WRAP.cpp | 0 .../{ => Implementations}/EGL/GLES/EGL_WRAP.h | 2 +- .../{ => Implementations}/EGL/VK/EGL_EMU.cpp | 0 .../{ => Implementations}/EGL/VK/EGL_EMU.h | 2 +- .../GL/Buffer/GL_Buffer.cpp | 0 .../GL/Buffer/GL_Buffer.h | 2 +- .../GL/Common/GL_Common.cpp | 0 .../GL/Common/GL_Common.h | 2 +- .../GL/Drawing/GL_Drawing.cpp | 0 .../GL/Drawing/GL_Drawing.h | 2 +- .../GL/Framebuffer/GL_Framebuffer.cpp | 0 .../GL/Framebuffer/GL_Framebuffer.h | 2 +- .../GLFuncsDefinitions.cpp} | 2 +- .../GLFuncsDefinitions/GLFuncsDefinitions.h | 10 ++++ .../GL/Getter/BackendInfo.cpp | 0 .../GL/Getter/BackendInfo.h | 2 +- .../GL/Getter/GL_Getter.cpp | 0 .../GL/Getter/GL_Getter.h | 2 +- .../GL/Program/GL_Program.cpp | 0 .../GL/Program/GL_Program.h | 2 +- .../GL/Shader/GL_Shader.cpp | 0 .../GL/Shader/GL_Shader.h | 2 +- .../GL/Texture/GL_Texture.cpp | 0 .../GL/Texture/GL_Texture.h | 2 +- .../GL/VertexArray/GL_VertexArray.cpp | 0 .../GL/VertexArray/GL_VertexArray.h | 2 +- .../GLX/LookUp/LookUp.cpp | 4 +- .../{ => Implementations}/GLX/LookUp/LookUp.h | 0 MG/MG_GL/State/Core/GLState.h | 2 +- MG/MG_RHI/GLES/Test/TestDrawing.cpp | 1 + 35 files changed, 65 insertions(+), 66 deletions(-) delete mode 100644 MG/MG_GL/GL_Def/GL_Def.h rename MG/MG_GL/{ => Implementations}/EGL/GLES/EGL_WRAP.cpp (100%) rename MG/MG_GL/{ => Implementations}/EGL/GLES/EGL_WRAP.h (85%) rename MG/MG_GL/{ => Implementations}/EGL/VK/EGL_EMU.cpp (100%) rename MG/MG_GL/{ => Implementations}/EGL/VK/EGL_EMU.h (99%) rename MG/MG_GL/{ => Implementations}/GL/Buffer/GL_Buffer.cpp (100%) rename MG/MG_GL/{ => Implementations}/GL/Buffer/GL_Buffer.h (82%) rename MG/MG_GL/{ => Implementations}/GL/Common/GL_Common.cpp (100%) rename MG/MG_GL/{ => Implementations}/GL/Common/GL_Common.h (91%) rename MG/MG_GL/{ => Implementations}/GL/Drawing/GL_Drawing.cpp (100%) rename MG/MG_GL/{ => Implementations}/GL/Drawing/GL_Drawing.h (90%) rename MG/MG_GL/{ => Implementations}/GL/Framebuffer/GL_Framebuffer.cpp (100%) rename MG/MG_GL/{ => Implementations}/GL/Framebuffer/GL_Framebuffer.h (86%) rename MG/MG_GL/{GL_Def/GL_Def.cpp => Implementations/GL/GLFuncsDefinitions/GLFuncsDefinitions.cpp} (99%) create mode 100644 MG/MG_GL/Implementations/GL/GLFuncsDefinitions/GLFuncsDefinitions.h rename MG/MG_GL/{ => Implementations}/GL/Getter/BackendInfo.cpp (100%) rename MG/MG_GL/{ => Implementations}/GL/Getter/BackendInfo.h (88%) rename MG/MG_GL/{ => Implementations}/GL/Getter/GL_Getter.cpp (100%) rename MG/MG_GL/{ => Implementations}/GL/Getter/GL_Getter.h (90%) rename MG/MG_GL/{ => Implementations}/GL/Program/GL_Program.cpp (100%) rename MG/MG_GL/{ => Implementations}/GL/Program/GL_Program.h (87%) rename MG/MG_GL/{ => Implementations}/GL/Shader/GL_Shader.cpp (100%) rename MG/MG_GL/{ => Implementations}/GL/Shader/GL_Shader.h (86%) rename MG/MG_GL/{ => Implementations}/GL/Texture/GL_Texture.cpp (100%) rename MG/MG_GL/{ => Implementations}/GL/Texture/GL_Texture.h (96%) rename MG/MG_GL/{ => Implementations}/GL/VertexArray/GL_VertexArray.cpp (100%) rename MG/MG_GL/{ => Implementations}/GL/VertexArray/GL_VertexArray.h (83%) rename MG/MG_GL/{ => Implementations}/GLX/LookUp/LookUp.cpp (90%) rename MG/MG_GL/{ => Implementations}/GLX/LookUp/LookUp.h (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0a9518b6..daa37a36 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,25 +25,35 @@ find_library(GLSLANG_LIB glslang PATHS ${CMAKE_SOURCE_DIR}/libraries/arm64-v8a/) add_library(${CMAKE_PROJECT_NAME} SHARED MG/Init.cpp - # MG_GL/GL - MG/MG_GL/GL/Getter/GL_Getter.cpp - MG/MG_GL/GL/Getter/BackendInfo.cpp + # MG_GL/Implementations/GL + MG/MG_GL/Implementations/GL/GLFuncsDefinitions/GLFuncsDefinitions.cpp - MG/MG_GL/GL/Framebuffer/GL_Framebuffer.cpp + MG/MG_GL/Implementations/GL/Getter/GL_Getter.cpp + MG/MG_GL/Implementations/GL/Getter/BackendInfo.cpp - MG/MG_GL/GL/Common/GL_Common.cpp + MG/MG_GL/Implementations/GL/Framebuffer/GL_Framebuffer.cpp - MG/MG_GL/GL/Buffer/GL_Buffer.cpp + MG/MG_GL/Implementations/GL/Common/GL_Common.cpp - MG/MG_GL/GL/Drawing/GL_Drawing.cpp + MG/MG_GL/Implementations/GL/Buffer/GL_Buffer.cpp - MG/MG_GL/GL/Program/GL_Program.cpp + MG/MG_GL/Implementations/GL/Drawing/GL_Drawing.cpp - MG/MG_GL/GL/Shader/GL_Shader.cpp + MG/MG_GL/Implementations/GL/Program/GL_Program.cpp - MG/MG_GL/GL/Texture/GL_Texture.cpp + MG/MG_GL/Implementations/GL/Shader/GL_Shader.cpp - MG/MG_GL/GL/VertexArray/GL_VertexArray.cpp + MG/MG_GL/Implementations/GL/Texture/GL_Texture.cpp + + MG/MG_GL/Implementations/GL/VertexArray/GL_VertexArray.cpp + + # MG_GL/Implementations/GLX + MG/MG_GL/Implementations/GLX/LookUp/LookUp.cpp + + # MG_GL/Implementations/EGL + MG/MG_GL/Implementations/EGL/VK/EGL_EMU.cpp + + MG/MG_GL/Implementations/EGL/GLES/EGL_WRAP.cpp # MG_GL/State MG/MG_GL/State/Core/GLState.cpp @@ -52,23 +62,12 @@ add_library(${CMAKE_PROJECT_NAME} SHARED MG/MG_GL/State/Texture/TextureState.cpp - # MG_GL/GLX - MG/MG_GL/GLX/LookUp/LookUp.cpp - - # MG_GL/GL_Def - MG/MG_GL/GL_Def/GL_Def.cpp + # MG_GL/BackendLoader + MG/MG_GL/BackendLoader/GLES/Loader.cpp # MG_UTIL/Debug MG/MG_UTIL/Debug/Debug.cpp - # MG_GL/EGL - MG/MG_GL/EGL/VK/EGL_EMU.cpp - - MG/MG_GL/EGL/GLES/EGL_WRAP.cpp - - # MG_GL/BackendLoader - MG/MG_GL/BackendLoader/GLES/Loader.cpp - # MG_RHI/GLES MG/MG_RHI/GLES/Test/TestDrawing.cpp ) diff --git a/MG/Global.h b/MG/Global.h index 2fb584b4..61adf95d 100644 --- a/MG/Global.h +++ b/MG/Global.h @@ -27,7 +27,7 @@ namespace MG_Global { } namespace Common { - inline const int LogLevel = MG_Constants::Common::LOG_LEVEL_DEBUG; + inline const int LogLevel = MG_Constants::Common::LOG_LEVEL_INFO; #ifdef __ANDROID__ inline const char* LOG_FILE_PATH = "/sdcard/MG/latest.log"; diff --git a/MG/Includes.h b/MG/Includes.h index 86fdb97a..91a18517 100644 --- a/MG/Includes.h +++ b/MG/Includes.h @@ -9,31 +9,31 @@ #include "MG_GL/BackendLoader/GLES/Loader.h" #endif #ifndef MOBILEGL_GL_FRAMEBUFFER_H -#include "MG_GL/GL/Framebuffer/GL_Framebuffer.h" +#include "MG_GL/Implementations/GL/Framebuffer/GL_Framebuffer.h" #endif #ifndef MOBILEGL_GL_GETTER_H -#include "MG_GL/GL/Getter/GL_Getter.h" +#include "MG_GL/Implementations/GL/Getter/GL_Getter.h" #endif #ifndef MOBILEGL_BACKENDINFO_H -#include "MG_GL/GL/Getter/BackendInfo.h" +#include "MG_GL/Implementations/GL/Getter/BackendInfo.h" #endif #ifndef MOBILEGL_GL_BUFFER_H -#include "MG_GL/GL/Buffer/GL_Buffer.h" +#include "MG_GL/Implementations/GL/Buffer/GL_Buffer.h" #endif #ifndef MOBILEGL_GL_DRAWING_H -#include "MG_GL/GL/Drawing/GL_Drawing.h" +#include "MG_GL/Implementations/GL/Drawing/GL_Drawing.h" #endif #ifndef MOBILEGL_GL_PROGRAM_H -#include "MG_GL/GL/Program/GL_Program.h" +#include "MG_GL/Implementations/GL/Program/GL_Program.h" #endif #ifndef MOBILEGL_GL_SHADER_H -#include "MG_GL/GL/Shader/GL_Shader.h" +#include "MG_GL/Implementations/GL/Shader/GL_Shader.h" #endif #ifndef MOBILEGL_GL_TEXTURE_H -#include "MG_GL/GL/Texture/GL_Texture.h" +#include "MG_GL/Implementations/GL/Texture/GL_Texture.h" #endif #ifndef MOBILEGL_GL_VERTEXARRAY_H -#include "MG_GL/GL/VertexArray/GL_VertexArray.h" +#include "MG_GL/Implementations/GL/VertexArray/GL_VertexArray.h" #endif #ifndef MOBILEGL_GLSTATE_H #include "MG_GL/State/Core/GLState.h" @@ -45,19 +45,19 @@ #include "MG_GL/State/Texture/TextureState.h" #endif #ifndef MOBILEGL_LOOKUP_H -#include "MG_GL/GLX/LookUp/LookUp.h" +#include "MG_GL/Implementations/GLX/LookUp/LookUp.h" #endif #ifndef MOBILEGL_DEBUG_H #include "MG_UTIL/Debug/Debug.h" #endif -#ifndef MOBILEGL_GL_DEPTH_H -#include "MG_GL/GL/Common/GL_Common.h" +#ifndef MOBILEGL_GL_COMMON_H +#include "MG_GL/Implementations/GL/Common/GL_Common.h" #endif #ifndef MOBILEGL_EGL_VK_EMU_H -#include "MG_GL/EGL/VK/EGL_EMU.h" +#include "MG_GL/Implementations/EGL/VK/EGL_EMU.h" #endif #ifndef MOBILEGL_EGL_GLES_EGL_WRAP_H -#include "MG_GL/EGL/GLES/EGL_WRAP.h" +#include "MG_GL/Implementations/EGL/GLES/EGL_WRAP.h" #endif #ifndef MOBILEGL_TESTDRAWING_H #include "MG_RHI/GLES/Test/TestDrawing.h" diff --git a/MG/MG_GL/BackendLoader/GLES/Loader.cpp b/MG/MG_GL/BackendLoader/GLES/Loader.cpp index 4ee1ad4a..d97ad943 100644 --- a/MG/MG_GL/BackendLoader/GLES/Loader.cpp +++ b/MG/MG_GL/BackendLoader/GLES/Loader.cpp @@ -6,6 +6,7 @@ #if BACKEND_TYPE == BACKEND_GLES +// TODO: Take this code file apart into multiple files. #define GL_FUNC_DECL(name) \ name##_PTR name; diff --git a/MG/MG_GL/GL_Def/GL_Def.h b/MG/MG_GL/GL_Def/GL_Def.h deleted file mode 100644 index 763ae356..00000000 --- a/MG/MG_GL/GL_Def/GL_Def.h +++ /dev/null @@ -1,10 +0,0 @@ -// -// Created by BZLZHH on 2025/3/15. -// - -#ifndef MOBILEGL_GL_DEF_H -#define MOBILEGL_GL_DEF_H - -#include "../../Includes.h" - -#endif //MOBILEGL_GL_DEF_H diff --git a/MG/MG_GL/EGL/GLES/EGL_WRAP.cpp b/MG/MG_GL/Implementations/EGL/GLES/EGL_WRAP.cpp similarity index 100% rename from MG/MG_GL/EGL/GLES/EGL_WRAP.cpp rename to MG/MG_GL/Implementations/EGL/GLES/EGL_WRAP.cpp diff --git a/MG/MG_GL/EGL/GLES/EGL_WRAP.h b/MG/MG_GL/Implementations/EGL/GLES/EGL_WRAP.h similarity index 85% rename from MG/MG_GL/EGL/GLES/EGL_WRAP.h rename to MG/MG_GL/Implementations/EGL/GLES/EGL_WRAP.h index 51d09687..86387480 100644 --- a/MG/MG_GL/EGL/GLES/EGL_WRAP.h +++ b/MG/MG_GL/Implementations/EGL/GLES/EGL_WRAP.h @@ -5,7 +5,7 @@ #ifndef MOBILEGL_EGL_GLES_EGL_WRAP_H #define MOBILEGL_EGL_GLES_EGL_WRAP_H -#include "../../../Includes.h" +#include "../../../../Includes.h" #if BACKEND_TYPE == BACKEND_GLES diff --git a/MG/MG_GL/EGL/VK/EGL_EMU.cpp b/MG/MG_GL/Implementations/EGL/VK/EGL_EMU.cpp similarity index 100% rename from MG/MG_GL/EGL/VK/EGL_EMU.cpp rename to MG/MG_GL/Implementations/EGL/VK/EGL_EMU.cpp diff --git a/MG/MG_GL/EGL/VK/EGL_EMU.h b/MG/MG_GL/Implementations/EGL/VK/EGL_EMU.h similarity index 99% rename from MG/MG_GL/EGL/VK/EGL_EMU.h rename to MG/MG_GL/Implementations/EGL/VK/EGL_EMU.h index 34391f3a..1274fa22 100644 --- a/MG/MG_GL/EGL/VK/EGL_EMU.h +++ b/MG/MG_GL/Implementations/EGL/VK/EGL_EMU.h @@ -5,7 +5,7 @@ #ifndef MOBILEGL_EGL_VK_EMU_H #define MOBILEGL_EGL_VK_EMU_H -#include "../../../Includes.h" +#include "../../../../Includes.h" #if BACKEND_TYPE == BACKEND_VULKAN diff --git a/MG/MG_GL/GL/Buffer/GL_Buffer.cpp b/MG/MG_GL/Implementations/GL/Buffer/GL_Buffer.cpp similarity index 100% rename from MG/MG_GL/GL/Buffer/GL_Buffer.cpp rename to MG/MG_GL/Implementations/GL/Buffer/GL_Buffer.cpp diff --git a/MG/MG_GL/GL/Buffer/GL_Buffer.h b/MG/MG_GL/Implementations/GL/Buffer/GL_Buffer.h similarity index 82% rename from MG/MG_GL/GL/Buffer/GL_Buffer.h rename to MG/MG_GL/Implementations/GL/Buffer/GL_Buffer.h index 45e0b939..01870b9e 100644 --- a/MG/MG_GL/GL/Buffer/GL_Buffer.h +++ b/MG/MG_GL/Implementations/GL/Buffer/GL_Buffer.h @@ -5,7 +5,7 @@ #ifndef MOBILEGL_GL_BUFFER_H #define MOBILEGL_GL_BUFFER_H -#include "../../../Includes.h" +#include "../../../../Includes.h" namespace MG_GL::GL { diff --git a/MG/MG_GL/GL/Common/GL_Common.cpp b/MG/MG_GL/Implementations/GL/Common/GL_Common.cpp similarity index 100% rename from MG/MG_GL/GL/Common/GL_Common.cpp rename to MG/MG_GL/Implementations/GL/Common/GL_Common.cpp diff --git a/MG/MG_GL/GL/Common/GL_Common.h b/MG/MG_GL/Implementations/GL/Common/GL_Common.h similarity index 91% rename from MG/MG_GL/GL/Common/GL_Common.h rename to MG/MG_GL/Implementations/GL/Common/GL_Common.h index f2e130ae..ed5f58a7 100644 --- a/MG/MG_GL/GL/Common/GL_Common.h +++ b/MG/MG_GL/Implementations/GL/Common/GL_Common.h @@ -5,7 +5,7 @@ #ifndef MOBILEGL_GL_COMMON_H #define MOBILEGL_GL_COMMON_H -#include "../../../Includes.h" +#include "../../../../Includes.h" namespace MG_GL::GL { void ClearDepth(::GLdouble depth); diff --git a/MG/MG_GL/GL/Drawing/GL_Drawing.cpp b/MG/MG_GL/Implementations/GL/Drawing/GL_Drawing.cpp similarity index 100% rename from MG/MG_GL/GL/Drawing/GL_Drawing.cpp rename to MG/MG_GL/Implementations/GL/Drawing/GL_Drawing.cpp diff --git a/MG/MG_GL/GL/Drawing/GL_Drawing.h b/MG/MG_GL/Implementations/GL/Drawing/GL_Drawing.h similarity index 90% rename from MG/MG_GL/GL/Drawing/GL_Drawing.h rename to MG/MG_GL/Implementations/GL/Drawing/GL_Drawing.h index dc1273a0..0eff0fcb 100644 --- a/MG/MG_GL/GL/Drawing/GL_Drawing.h +++ b/MG/MG_GL/Implementations/GL/Drawing/GL_Drawing.h @@ -5,7 +5,7 @@ #ifndef MOBILEGL_GL_DRAWING_H #define MOBILEGL_GL_DRAWING_H -#include "../../../Includes.h" +#include "../../../../Includes.h" namespace MG_GL::GL { void DrawElements(GLenum mode, GLsizei count, GLenum type, const void *indices); diff --git a/MG/MG_GL/GL/Framebuffer/GL_Framebuffer.cpp b/MG/MG_GL/Implementations/GL/Framebuffer/GL_Framebuffer.cpp similarity index 100% rename from MG/MG_GL/GL/Framebuffer/GL_Framebuffer.cpp rename to MG/MG_GL/Implementations/GL/Framebuffer/GL_Framebuffer.cpp diff --git a/MG/MG_GL/GL/Framebuffer/GL_Framebuffer.h b/MG/MG_GL/Implementations/GL/Framebuffer/GL_Framebuffer.h similarity index 86% rename from MG/MG_GL/GL/Framebuffer/GL_Framebuffer.h rename to MG/MG_GL/Implementations/GL/Framebuffer/GL_Framebuffer.h index 608bb7c8..36946301 100644 --- a/MG/MG_GL/GL/Framebuffer/GL_Framebuffer.h +++ b/MG/MG_GL/Implementations/GL/Framebuffer/GL_Framebuffer.h @@ -5,7 +5,7 @@ #ifndef MOBILEGL_GL_FRAMEBUFFER_H #define MOBILEGL_GL_FRAMEBUFFER_H -#include "../../../Includes.h" +#include "../../../../Includes.h" namespace MG_GL::GL { GLenum CheckFramebufferStatus(GLenum target); diff --git a/MG/MG_GL/GL_Def/GL_Def.cpp b/MG/MG_GL/Implementations/GL/GLFuncsDefinitions/GLFuncsDefinitions.cpp similarity index 99% rename from MG/MG_GL/GL_Def/GL_Def.cpp rename to MG/MG_GL/Implementations/GL/GLFuncsDefinitions/GLFuncsDefinitions.cpp index 7a94368c..d77e1535 100644 --- a/MG/MG_GL/GL_Def/GL_Def.cpp +++ b/MG/MG_GL/Implementations/GL/GLFuncsDefinitions/GLFuncsDefinitions.cpp @@ -2,7 +2,7 @@ // Created by BZLZHH on 2025/3/15. // -#include "GL_Def.h" +#include "GLFuncsDefinitions.h" #define DECLARE_GL_FUNCTION_STUB_HEAD(type,name,...) \ MG_EXPORT type gl##name(__VA_ARGS__) { diff --git a/MG/MG_GL/Implementations/GL/GLFuncsDefinitions/GLFuncsDefinitions.h b/MG/MG_GL/Implementations/GL/GLFuncsDefinitions/GLFuncsDefinitions.h new file mode 100644 index 00000000..c6e96b4c --- /dev/null +++ b/MG/MG_GL/Implementations/GL/GLFuncsDefinitions/GLFuncsDefinitions.h @@ -0,0 +1,10 @@ +// +// Created by BZLZHH on 2025/3/15. +// + +#ifndef MOBILEGL_GL_FUNCS_DEFINITIONS_H +#define MOBILEGL_GL_FUNCS_DEFINITIONS_H + +#include "../../../../Includes.h" + +#endif //MOBILEGL_GL_FUNCS_DEFINITIONS_H diff --git a/MG/MG_GL/GL/Getter/BackendInfo.cpp b/MG/MG_GL/Implementations/GL/Getter/BackendInfo.cpp similarity index 100% rename from MG/MG_GL/GL/Getter/BackendInfo.cpp rename to MG/MG_GL/Implementations/GL/Getter/BackendInfo.cpp diff --git a/MG/MG_GL/GL/Getter/BackendInfo.h b/MG/MG_GL/Implementations/GL/Getter/BackendInfo.h similarity index 88% rename from MG/MG_GL/GL/Getter/BackendInfo.h rename to MG/MG_GL/Implementations/GL/Getter/BackendInfo.h index 319c766e..38203e03 100644 --- a/MG/MG_GL/GL/Getter/BackendInfo.h +++ b/MG/MG_GL/Implementations/GL/Getter/BackendInfo.h @@ -5,7 +5,7 @@ #ifndef MOBILEGL_BACKENDINFO_H #define MOBILEGL_BACKENDINFO_H -#include "../../../Includes.h" +#include "../../../../Includes.h" namespace MG_GL::Getter { const std::string GetBackendName(); diff --git a/MG/MG_GL/GL/Getter/GL_Getter.cpp b/MG/MG_GL/Implementations/GL/Getter/GL_Getter.cpp similarity index 100% rename from MG/MG_GL/GL/Getter/GL_Getter.cpp rename to MG/MG_GL/Implementations/GL/Getter/GL_Getter.cpp diff --git a/MG/MG_GL/GL/Getter/GL_Getter.h b/MG/MG_GL/Implementations/GL/Getter/GL_Getter.h similarity index 90% rename from MG/MG_GL/GL/Getter/GL_Getter.h rename to MG/MG_GL/Implementations/GL/Getter/GL_Getter.h index 24b409a1..886e2e27 100644 --- a/MG/MG_GL/GL/Getter/GL_Getter.h +++ b/MG/MG_GL/Implementations/GL/Getter/GL_Getter.h @@ -5,7 +5,7 @@ #ifndef MOBILEGL_GL_GETTER_H #define MOBILEGL_GL_GETTER_H -#include "../../../Includes.h" +#include "../../../../Includes.h" namespace MG_GL::GL { const ::GLubyte* GetString(GLenum name); diff --git a/MG/MG_GL/GL/Program/GL_Program.cpp b/MG/MG_GL/Implementations/GL/Program/GL_Program.cpp similarity index 100% rename from MG/MG_GL/GL/Program/GL_Program.cpp rename to MG/MG_GL/Implementations/GL/Program/GL_Program.cpp diff --git a/MG/MG_GL/GL/Program/GL_Program.h b/MG/MG_GL/Implementations/GL/Program/GL_Program.h similarity index 87% rename from MG/MG_GL/GL/Program/GL_Program.h rename to MG/MG_GL/Implementations/GL/Program/GL_Program.h index 580557cf..89ff17ab 100644 --- a/MG/MG_GL/GL/Program/GL_Program.h +++ b/MG/MG_GL/Implementations/GL/Program/GL_Program.h @@ -5,7 +5,7 @@ #ifndef MOBILEGL_GL_PROGRAM_H #define MOBILEGL_GL_PROGRAM_H -#include "../../../Includes.h" +#include "../../../../Includes.h" namespace MG_GL::GL { void GetProgramiv(GLuint program, GLenum pname, GLint *params); diff --git a/MG/MG_GL/GL/Shader/GL_Shader.cpp b/MG/MG_GL/Implementations/GL/Shader/GL_Shader.cpp similarity index 100% rename from MG/MG_GL/GL/Shader/GL_Shader.cpp rename to MG/MG_GL/Implementations/GL/Shader/GL_Shader.cpp diff --git a/MG/MG_GL/GL/Shader/GL_Shader.h b/MG/MG_GL/Implementations/GL/Shader/GL_Shader.h similarity index 86% rename from MG/MG_GL/GL/Shader/GL_Shader.h rename to MG/MG_GL/Implementations/GL/Shader/GL_Shader.h index 28a20f11..40081308 100644 --- a/MG/MG_GL/GL/Shader/GL_Shader.h +++ b/MG/MG_GL/Implementations/GL/Shader/GL_Shader.h @@ -5,7 +5,7 @@ #ifndef MOBILEGL_GL_SHADER_H #define MOBILEGL_GL_SHADER_H -#include "../../../Includes.h" +#include "../../../../Includes.h" namespace MG_GL::GL { void GetShaderiv(GLuint shader, GLenum pname, GLint *params); diff --git a/MG/MG_GL/GL/Texture/GL_Texture.cpp b/MG/MG_GL/Implementations/GL/Texture/GL_Texture.cpp similarity index 100% rename from MG/MG_GL/GL/Texture/GL_Texture.cpp rename to MG/MG_GL/Implementations/GL/Texture/GL_Texture.cpp diff --git a/MG/MG_GL/GL/Texture/GL_Texture.h b/MG/MG_GL/Implementations/GL/Texture/GL_Texture.h similarity index 96% rename from MG/MG_GL/GL/Texture/GL_Texture.h rename to MG/MG_GL/Implementations/GL/Texture/GL_Texture.h index 758d0467..58ff7974 100644 --- a/MG/MG_GL/GL/Texture/GL_Texture.h +++ b/MG/MG_GL/Implementations/GL/Texture/GL_Texture.h @@ -5,7 +5,7 @@ #ifndef MOBILEGL_GL_TEXTURE_H #define MOBILEGL_GL_TEXTURE_H -#include "../../../Includes.h" +#include "../../../../Includes.h" namespace MG_GL::GL { void ActiveTexture(GLenum texture); diff --git a/MG/MG_GL/GL/VertexArray/GL_VertexArray.cpp b/MG/MG_GL/Implementations/GL/VertexArray/GL_VertexArray.cpp similarity index 100% rename from MG/MG_GL/GL/VertexArray/GL_VertexArray.cpp rename to MG/MG_GL/Implementations/GL/VertexArray/GL_VertexArray.cpp diff --git a/MG/MG_GL/GL/VertexArray/GL_VertexArray.h b/MG/MG_GL/Implementations/GL/VertexArray/GL_VertexArray.h similarity index 83% rename from MG/MG_GL/GL/VertexArray/GL_VertexArray.h rename to MG/MG_GL/Implementations/GL/VertexArray/GL_VertexArray.h index ec0de6da..61f3433c 100644 --- a/MG/MG_GL/GL/VertexArray/GL_VertexArray.h +++ b/MG/MG_GL/Implementations/GL/VertexArray/GL_VertexArray.h @@ -5,7 +5,7 @@ #ifndef MOBILEGL_GL_VERTEXARRAY_H #define MOBILEGL_GL_VERTEXARRAY_H -#include "../../../Includes.h" +#include "../../../../Includes.h" namespace MG_GL::GL { diff --git a/MG/MG_GL/GLX/LookUp/LookUp.cpp b/MG/MG_GL/Implementations/GLX/LookUp/LookUp.cpp similarity index 90% rename from MG/MG_GL/GLX/LookUp/LookUp.cpp rename to MG/MG_GL/Implementations/GLX/LookUp/LookUp.cpp index a833bcd0..9f210a88 100644 --- a/MG/MG_GL/GLX/LookUp/LookUp.cpp +++ b/MG/MG_GL/Implementations/GLX/LookUp/LookUp.cpp @@ -4,9 +4,7 @@ #include "LookUp.h" -#include "../../../Includes.h" - -#define DEBUG 0 +#include "../../../../Includes.h" namespace MG_GL::GLX { void* GetProcAddress(const char *name) { diff --git a/MG/MG_GL/GLX/LookUp/LookUp.h b/MG/MG_GL/Implementations/GLX/LookUp/LookUp.h similarity index 100% rename from MG/MG_GL/GLX/LookUp/LookUp.h rename to MG/MG_GL/Implementations/GLX/LookUp/LookUp.h diff --git a/MG/MG_GL/State/Core/GLState.h b/MG/MG_GL/State/Core/GLState.h index 26e1ec15..31b906cb 100644 --- a/MG/MG_GL/State/Core/GLState.h +++ b/MG/MG_GL/State/Core/GLState.h @@ -12,7 +12,7 @@ struct MG_State_T { static TextureState* textureState; static CommonState* commonState; }; - + namespace MG_State { extern MG_State_T* MG_State_O; diff --git a/MG/MG_RHI/GLES/Test/TestDrawing.cpp b/MG/MG_RHI/GLES/Test/TestDrawing.cpp index 8094adff..1bb9bbd9 100644 --- a/MG/MG_RHI/GLES/Test/TestDrawing.cpp +++ b/MG/MG_RHI/GLES/Test/TestDrawing.cpp @@ -37,6 +37,7 @@ namespace MG_RHI::GLES::Test { return true; } + // TODO: Use the textures state from MG_RHI(another state?) rather than directly from MG_State void DrawAllTextures() { ::GLES::glClearColor(1,1,1,1); ::GLES::glClear(GL_COLOR_BUFFER_BIT);