diff --git a/src/main/cpp/gl/getter.cpp b/src/main/cpp/gl/getter.cpp index fec8789..e9d9e53 100644 --- a/src/main/cpp/gl/getter.cpp +++ b/src/main/cpp/gl/getter.cpp @@ -136,6 +136,7 @@ const char* getGLESName() { } static std::string rendererString; +static std::string versionString; const GLubyte * glGetString( GLenum name ) { LOG(); LOAD_GLES_FUNC(glGetString); @@ -156,9 +157,19 @@ const GLubyte * glGetString( GLenum name ) { */ switch (name) { case GL_VENDOR: - return (const GLubyte *) "Swung0x48, BZLZHH, Tungsten"; + return (const GLubyte *)(std::string("Swung0x48, BZLZHH, Tungsten") + + std::string(version_type == VERSION_ALPHA ? " | §c§l内测版本, 严禁任何外传!§r" : "")).c_str(); case GL_VERSION: - return (const GLubyte *) "4.0.0 MobileGlues"; + if (versionString == std::string("")) { + versionString = "4.0.0 MobileGlues"; + std::string realVersion = " " + std::to_string(MAJOR) + "." + + std::to_string(MINOR) + "." + + std::to_string(REVISION); + std::string suffix = version_type == VERSION_ALPHA ? " | §4§l您如果在公开平台看到这一提示, 则发布者已违规!§r" : + realVersion + std::string(version_type == VERSION_DEVELOPMENT?".Dev":""); + versionString += suffix; + } + return (const GLubyte *)versionString.c_str(); case GL_RENDERER: { if (rendererString == std::string("")) { diff --git a/src/main/cpp/gl/getter.h b/src/main/cpp/gl/getter.h index 3e04da7..b609e60 100644 --- a/src/main/cpp/gl/getter.h +++ b/src/main/cpp/gl/getter.h @@ -9,6 +9,7 @@ #include "loader.h" #include "../gles/loader.h" #include "mg.h" +#include "../version.h" #ifndef MOBILEGLUES_GETTER_H #define MOBILEGLUES_GETTER_H diff --git a/src/main/cpp/version.h b/src/main/cpp/version.h new file mode 100644 index 0000000..64f54b4 --- /dev/null +++ b/src/main/cpp/version.h @@ -0,0 +1,19 @@ +// +// Created by BZLZHH on 2025/2/8. +// + +#ifndef MOBILEGLUES_VERSION_H + +#define VERSION_DEVELOPMENT 0 +#define VERSION_ALPHA 1 +#define VERSION_RELEASE 2 + +#define MAJOR 0 +#define MINOR 0 +#define REVISION 1 + +const int version_type = VERSION_ALPHA; + +#define MOBILEGLUES_VERSION_H + +#endif //MOBILEGLUES_VERSION_H