mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-09 12:48:32 +09:00
[Fix] (MG_Impl/GL): Correct GL_SHADING_LANGUAGE_VERSION in glGet.
This commit is contained in:
@@ -43,8 +43,9 @@ namespace MobileGL {
|
||||
case GL_SHADING_LANGUAGE_VERSION:
|
||||
static String shadingLanguageVersion;
|
||||
if (shadingLanguageVersion.empty()) {
|
||||
shadingLanguageVersion = std::format("{} MobileGL",
|
||||
MG_Config::RendererInfoPtr->RendererGLInfo.TargetGLSLVersion.toString().c_str());
|
||||
shadingLanguageVersion = std::format("{} MobileGL",
|
||||
MG_Config::RendererInfoPtr->RendererGLInfo.TargetGLSLVersion.toString(
|
||||
{ true, false }).c_str());
|
||||
}
|
||||
return (const GLubyte*)shadingLanguageVersion.c_str();
|
||||
case GL_EXTENSIONS:
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace MobileGL {
|
||||
using String = std::string;
|
||||
using StringStream = std::stringstream;
|
||||
using Int8 = int8_t;
|
||||
using Uint8 = uint8_t;
|
||||
using Int16 = int16_t;
|
||||
@@ -17,6 +18,8 @@ namespace MobileGL {
|
||||
using Double = double;
|
||||
template <typename T>
|
||||
using Vector = std::vector<T>;
|
||||
template <typename T, typename N>
|
||||
using Pair = std::pair<T, N>;
|
||||
template <typename T>
|
||||
using SharedPtr = std::shared_ptr<T>;
|
||||
template <typename T>
|
||||
@@ -61,12 +64,11 @@ namespace MobileGL {
|
||||
Int Patch;
|
||||
Optional<String> Suffix;
|
||||
|
||||
String toString() const {
|
||||
String versionStr = std::format("{}.{}.{}", Major, Minor, Patch);
|
||||
if (Suffix.has_value()) {
|
||||
versionStr += std::format("{}", Suffix.value());
|
||||
}
|
||||
return versionStr;
|
||||
String toString(Pair<Bool, Bool> dots = { true, true }, Bool useSuffix = true) const {
|
||||
StringStream result;
|
||||
result << Major << (dots.first ? "." : "") << Minor << (dots.second ? "." : "") << Patch <<
|
||||
(useSuffix && Suffix.has_value() ? *Suffix : "");
|
||||
return result.str();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user