mirror of
https://github.com/wolfpld/tracy.git
synced 2026-08-07 13:59:17 +00:00
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.
This commit is contained in:
24
profiler/src/NativeWindow.cpp
Normal file
24
profiler/src/NativeWindow.cpp
Normal file
@@ -0,0 +1,24 @@
|
||||
#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
|
||||
}
|
||||
Reference in New Issue
Block a user