1
0
mirror of https://github.com/wolfpld/tracy synced 2025-05-03 14:03:52 +00:00
tracy/profiler/src/NativeWindow.cpp
Bartosz Taudul 52039e80f2 Add native window retrieval on Linux.
Functionality had to be moved to a separate source file due to namespace
pollution from X11 headers.

Note that this doesn't set proper parent of file dialogs on Linux, as
GTK is broken and requires passing a GtkWindow parent.
2020-08-15 16:53:07 +02:00

25 lines
475 B
C++

#include "NativeWindow.hpp"
#include <GLFW/glfw3.h>
#ifdef _WIN32
# define GLFW_EXPOSE_NATIVE_WIN32
# include <GLFW/glfw3native.h>
#elif defined __linux__
# define GLFW_EXPOSE_NATIVE_X11
# include <GLFW/glfw3native.h>
#endif
extern GLFWwindow* s_glfwWindow;
void* GetMainWindowNative()
{
#ifdef _WIN32
return (void*)glfwGetWin32Window( s_glfwWindow );
#elif defined __linux__
return (void*)glfwGetX11Window( s_glfwWindow );
#else
return nullptr;
#endif
}