From 7577d49c39fefb2eaf9669706c48f2061a77d3e9 Mon Sep 17 00:00:00 2001 From: Andrew Belt Date: Tue, 5 May 2020 10:29:27 -0400 Subject: [PATCH] Add native parent handle argument to Window constructor. --- include/window.hpp | 2 +- src/window.cpp | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/window.hpp b/include/window.hpp index e0aaa382..0700a1d5 100644 --- a/include/window.hpp +++ b/include/window.hpp @@ -75,7 +75,7 @@ struct Window { std::map> imageCache; std::map> svgCache; - Window(); + Window(void* handle = NULL); ~Window(); void run(); /** Takes a screenshot of each module */ diff --git a/src/window.cpp b/src/window.cpp index 789c9614..42bb5700 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -214,7 +214,7 @@ static void errorCallback(int error, const char* description) { WARN("GLFW error %d: %s", error, description); } -Window::Window() { +Window::Window(void* handle) { internal = new Internal; int err; @@ -235,6 +235,9 @@ Window::Window() { glfwWindowHint(GLFW_COCOA_RETINA_FRAMEBUFFER, GLFW_TRUE); #endif + if (handle) + glfwWindowHintPointer(GLFW_NATIVE_PARENT_HANDLE, handle); + // Create window win = glfwCreateWindow(800, 600, "", NULL, NULL); if (!win) {