[gtkmm] Gdk::GLContext: Ignore deprecation of gdk_gl_context_set_use_es()
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm] Gdk::GLContext: Ignore deprecation of gdk_gl_context_set_use_es()
- Date: Wed, 20 Oct 2021 16:58:30 +0000 (UTC)
commit 05b99d95b2a7e6b4f1025a35bbdf168b37fccdbd
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date: Wed Oct 20 18:56:33 2021 +0200
Gdk::GLContext: Ignore deprecation of gdk_gl_context_set_use_es()
gdk/src/glcontext.ccg | 12 ++++++++++++
gdk/src/glcontext.hg | 10 +++++++++-
2 files changed, 21 insertions(+), 1 deletion(-)
---
diff --git a/gdk/src/glcontext.ccg b/gdk/src/glcontext.ccg
index d4202796..b6ede0ff 100644
--- a/gdk/src/glcontext.ccg
+++ b/gdk/src/glcontext.ccg
@@ -20,9 +20,21 @@
namespace Gdk
{
+
+// We hand-code set_use_es() and unset_use_es().
+// gdk_gl_context_set_use_es() is deprecated in gtk 4.6.
+// We can't use the replacement gdk_gl_context_set_allowed_apis(),
+// which is new in gtk 4.6. This version of gtkmm does not require gtk 4.6.
+G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+void GLContext::set_use_es(bool use_es)
+{
+ gdk_gl_context_set_use_es(gobj(), static_cast<int>(use_es));
+}
+
void GLContext::unset_use_es()
{
gdk_gl_context_set_use_es(gobj(), -1);
}
+G_GNUC_END_IGNORE_DEPRECATIONS
} // namespace Gdk
diff --git a/gdk/src/glcontext.hg b/gdk/src/glcontext.hg
index 3ec3de7b..d76a1162 100644
--- a/gdk/src/glcontext.hg
+++ b/gdk/src/glcontext.hg
@@ -60,6 +60,13 @@ public:
_WRAP_METHOD(bool get_forward_compatible() const, gdk_gl_context_get_forward_compatible, newin "3,18")
_WRAP_METHOD(void set_forward_compatible(bool compatible = true), gdk_gl_context_set_forward_compatible,
newin "3,18")
+ // We hand-code set_use_es() and unset_use_es().
+ // gdk_gl_context_set_use_es() is deprecated in gtk 4.6.
+ // We can't use the replacement gdk_gl_context_set_allowed_apis(),
+ // which is new in gtk 4.6. This version of gtkmm does not require gtk 4.6.
+ //_WRAP_METHOD(void set_use_es(bool use_es = true), gdk_gl_context_set_use_es,
+ // deprecated "Use set_allowed_apis() instead.")
+
/** Requests that GDK create an OpenGL ES context instead of an OpenGL one,
* if the platform and windowing system allows it.
*
@@ -77,7 +84,8 @@ public:
*
* @param use_es Whether the context should use OpenGL ES instead of OpenGL.
*/
- _WRAP_METHOD(void set_use_es(bool use_es = true), gdk_gl_context_set_use_es)
+ void set_use_es(bool use_es = true);
+ _IGNORE(gdk_gl_context_set_use_es)
/** Undo a previous call to set_use_es().
*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]