From ffd1256d5a38d473c811b8738cc88e3b296d874d Mon Sep 17 00:00:00 2001 From: T1ti <40864460+T1ti@users.noreply.github.com> Date: Mon, 26 Aug 2024 05:13:30 +0200 Subject: [PATCH] context: add has_extension function https://github.com/wowdev/noggit3/commit/a7eb763976b7f1a10c85784164745aff2b35898d --- src/opengl/context.hpp | 2 ++ src/opengl/context.inl | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/src/opengl/context.hpp b/src/opengl/context.hpp index 3b217036..53868936 100755 --- a/src/opengl/context.hpp +++ b/src/opengl/context.hpp @@ -55,6 +55,8 @@ namespace OpenGL QOpenGLContext* _current_context = nullptr; QOpenGLFunctions_4_1_Core* _4_1_core_func = nullptr; + NOGGIT_FORCEINLINE bool has_extension(std::string const& name); + NOGGIT_FORCEINLINE void enable (GLenum); NOGGIT_FORCEINLINE void disable (GLenum); NOGGIT_FORCEINLINE GLboolean isEnabled (GLenum); diff --git a/src/opengl/context.inl b/src/opengl/context.inl index 4a1fb520..a2d898a9 100755 --- a/src/opengl/context.inl +++ b/src/opengl/context.inl @@ -127,6 +127,11 @@ namespace }; } +bool OpenGL::context::has_extension(std::string const& name) +{ + return _current_context->hasExtension(QByteArray::fromStdString(name)); +} + void OpenGL::context::enable (GLenum target) { #ifndef NOGGIT_DO_NOT_CHECK_FOR_OPENGL_ERRORS