diff --git a/profiler/build/win32/Tracy.vcxproj b/profiler/build/win32/Tracy.vcxproj
index 9236c5c8..46455405 100644
--- a/profiler/build/win32/Tracy.vcxproj
+++ b/profiler/build/win32/Tracy.vcxproj
@@ -160,6 +160,7 @@
+
NotSet
diff --git a/profiler/build/win32/Tracy.vcxproj.filters b/profiler/build/win32/Tracy.vcxproj.filters
index 4896670b..8a335c86 100644
--- a/profiler/build/win32/Tracy.vcxproj.filters
+++ b/profiler/build/win32/Tracy.vcxproj.filters
@@ -42,6 +42,9 @@
src
+
+ src
+
gl3w
diff --git a/profiler/src/NativeWindow.cpp b/profiler/src/NativeWindow.cpp
new file mode 100644
index 00000000..79ac0f60
--- /dev/null
+++ b/profiler/src/NativeWindow.cpp
@@ -0,0 +1,24 @@
+#include "NativeWindow.hpp"
+
+#include
+
+#ifdef _WIN32
+# define GLFW_EXPOSE_NATIVE_WIN32
+# include
+#elif defined __linux__
+# define GLFW_EXPOSE_NATIVE_X11
+# include
+#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
+}
diff --git a/profiler/src/NativeWindow.hpp b/profiler/src/NativeWindow.hpp
new file mode 100644
index 00000000..499b3395
--- /dev/null
+++ b/profiler/src/NativeWindow.hpp
@@ -0,0 +1,6 @@
+#ifndef __NATIVEWINDOW_HPP__
+#define __NATIVEWINDOW_HPP__
+
+void* GetMainWindowNative();
+
+#endif
diff --git a/profiler/src/main.cpp b/profiler/src/main.cpp
index 4cfa4786..b8128860 100644
--- a/profiler/src/main.cpp
+++ b/profiler/src/main.cpp
@@ -22,8 +22,6 @@
#ifdef _WIN32
# include
# include
-# define GLFW_EXPOSE_NATIVE_WIN32
-# include
#endif
#define STB_IMAGE_IMPLEMENTATION
@@ -50,6 +48,7 @@
#include "FontAwesomeSolid.hpp"
#include "icon.hpp"
#include "ResolvService.hpp"
+#include "NativeWindow.hpp"
static void glfw_error_callback(int error, const char* description)
{
@@ -71,7 +70,7 @@ static void OpenWebpage( const char* url )
#endif
}
-static GLFWwindow* s_glfwWindow = nullptr;
+GLFWwindow* s_glfwWindow = nullptr;
static bool s_customTitle = false;
static void SetWindowTitleCallback( const char* title )
{
@@ -88,15 +87,6 @@ static void WindowRefreshCallback( GLFWwindow* window )
DrawContents();
}
-void* GetMainWindowNative()
-{
-#ifdef _WIN32
- return (void*)glfwGetWin32Window( s_glfwWindow );
-#else
- return nullptr;
-#endif
-}
-
std::vector::const_iterator> RebuildConnectionHistory( const std::unordered_map& connHistMap )
{
std::vector::const_iterator> ret;