Browse Source

Add native parent handle argument to Window constructor.

tags/v2.0.0
Andrew Belt 5 years ago
parent
commit
7577d49c39
2 changed files with 5 additions and 2 deletions
  1. +1
    -1
      include/window.hpp
  2. +4
    -1
      src/window.cpp

+ 1
- 1
include/window.hpp View File

@@ -75,7 +75,7 @@ struct Window {
std::map<std::string, std::weak_ptr<Image>> imageCache; std::map<std::string, std::weak_ptr<Image>> imageCache;
std::map<std::string, std::weak_ptr<Svg>> svgCache; std::map<std::string, std::weak_ptr<Svg>> svgCache;


Window();
Window(void* handle = NULL);
~Window(); ~Window();
void run(); void run();
/** Takes a screenshot of each module */ /** Takes a screenshot of each module */


+ 4
- 1
src/window.cpp View File

@@ -214,7 +214,7 @@ static void errorCallback(int error, const char* description) {
WARN("GLFW error %d: %s", error, description); WARN("GLFW error %d: %s", error, description);
} }


Window::Window() {
Window::Window(void* handle) {
internal = new Internal; internal = new Internal;
int err; int err;


@@ -235,6 +235,9 @@ Window::Window() {
glfwWindowHint(GLFW_COCOA_RETINA_FRAMEBUFFER, GLFW_TRUE); glfwWindowHint(GLFW_COCOA_RETINA_FRAMEBUFFER, GLFW_TRUE);
#endif #endif


if (handle)
glfwWindowHintPointer(GLFW_NATIVE_PARENT_HANDLE, handle);

// Create window // Create window
win = glfwCreateWindow(800, 600, "", NULL, NULL); win = glfwCreateWindow(800, 600, "", NULL, NULL);
if (!win) { if (!win) {


Loading…
Cancel
Save