commit 9b838a67d2e07ea72c198e291f7eb654fef541fd
parent 3c37d4c096dd4decac225c62ca78a0d7526a18ed
Author: falkTX <falktx@falktx.com>
Date: Sat, 21 Aug 2021 01:43:13 +0100
TESTING: Add DGL_USE_OPENGL3 macro
Diffstat:
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/dgl/Makefile b/dgl/Makefile
@@ -13,6 +13,10 @@ BUILD_CXX_FLAGS += $(DGL_FLAGS) -I. -Isrc -DDONT_SET_USING_DGL_NAMESPACE -Wno-un
BUILD_CXX_FLAGS += -Isrc/pugl-upstream/include
LINK_FLAGS += $(DGL_LIBS)
+ifeq ($(USE_OPENGL3),true)
+BUILD_CXX_FLAGS += -DDGL_USE_OPENGL3
+endif
+
# TODO fix these after pugl-upstream is done
BUILD_CXX_FLAGS += -Wno-attributes -Wno-extra -Wno-missing-field-initializers
ifneq ($(MACOS),true)
diff --git a/dgl/src/WindowPrivateData.cpp b/dgl/src/WindowPrivateData.cpp
@@ -234,6 +234,10 @@ void Window::PrivateData::initPre(const uint width, const uint height, const boo
puglSetViewHint(view, PUGL_IGNORE_KEY_REPEAT, PUGL_FALSE);
puglSetViewHint(view, PUGL_DEPTH_BITS, 16);
puglSetViewHint(view, PUGL_STENCIL_BITS, 8);
+#ifdef DGL_USE_OPENGL3
+ puglSetViewHint(view, PUGL_USE_COMPAT_PROFILE, PUGL_FALSE);
+ puglSetViewHint(view, PUGL_CONTEXT_VERSION_MAJOR, 3);
+#endif
// PUGL_SAMPLES ??
puglSetEventFunc(view, puglEventCallback);
}