mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-11 21:58:31 +09:00
[Fix] (MG_Impl/Getter): don't ask system GL for context flags
This commit is contained in:
@@ -22,24 +22,9 @@
|
|||||||
#include <MG_State/GLState/FramebufferState/FramebufferObject.h>
|
#include <MG_State/GLState/FramebufferState/FramebufferObject.h>
|
||||||
#include <MG_Util/Texture/TextureFormatProcessor.h>
|
#include <MG_Util/Texture/TextureFormatProcessor.h>
|
||||||
#include <MG_Backend/BackendObjects.h>
|
#include <MG_Backend/BackendObjects.h>
|
||||||
#if !defined(_WIN32)
|
|
||||||
#include <dlfcn.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace MobileGL::MG_Impl::GLImpl {
|
namespace MobileGL::MG_Impl::GLImpl {
|
||||||
namespace {
|
namespace {
|
||||||
bool TryGetNativeContextFlags(GLint* flags) {
|
|
||||||
#if !defined(_WIN32)
|
|
||||||
using GLGetIntegervFn = void (*)(GLenum, GLint*);
|
|
||||||
static auto* nextGetIntegerv = reinterpret_cast<GLGetIntegervFn>(dlsym(RTLD_NEXT, "glGetIntegerv"));
|
|
||||||
if (nextGetIntegerv) {
|
|
||||||
nextGetIntegerv(GL_CONTEXT_FLAGS, flags);
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
enum class IndexedBufferQueryKind {
|
enum class IndexedBufferQueryKind {
|
||||||
Binding,
|
Binding,
|
||||||
Start,
|
Start,
|
||||||
@@ -959,9 +944,6 @@ namespace MobileGL::MG_Impl::GLImpl {
|
|||||||
return;
|
return;
|
||||||
case GL_CONTEXT_FLAGS: {
|
case GL_CONTEXT_FLAGS: {
|
||||||
*params = MG_State::pEGLContext ? MG_State::pEGLContext->GetCurrentContextFlags() : 0;
|
*params = MG_State::pEGLContext ? MG_State::pEGLContext->GetCurrentContextFlags() : 0;
|
||||||
if (*params == 0) {
|
|
||||||
TryGetNativeContextFlags(params);
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case GL_CULL_FACE:
|
case GL_CULL_FACE:
|
||||||
|
|||||||
Reference in New Issue
Block a user