aboutsummaryrefslogtreecommitdiff
path: root/ports/glbinding/0002_fix-uwpmacro.patch
blob: 61c179662c3fa5e2b35dfa107fcf4b600bce1568 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
diff --git a/source/glbinding/CMakeLists.txt b/source/glbinding/CMakeLists.txt
index 97654c8..bca68d1 100644
--- a/source/glbinding/CMakeLists.txt
+++ b/source/glbinding/CMakeLists.txt
@@ -261,6 +261,11 @@ target_link_libraries(${target}
 # Compile definitions
 # 
 
+
+if (CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
+  target_compile_definitions(${target} PRIVATE SYSTEM_WINDOWS WINDOWS_STORE)
+endif()
+
 target_compile_definitions(${target}
     PRIVATE
     # since we use stl and stl is intended to use exceptions, exceptions should not be disabled
diff --git a/source/glbinding/source/getProcAddress.cpp b/source/glbinding/source/getProcAddress.cpp
index c1cfc5c..7e5f8bc 100644
--- a/source/glbinding/source/getProcAddress.cpp
+++ b/source/glbinding/source/getProcAddress.cpp
@@ -18,7 +18,11 @@ namespace glbinding {
 
 ProcAddress getProcAddress(const char * name)
 {
-    static auto module = LoadLibrary(_T("OPENGL32.DLL"));
+#ifdef WINDOWS_STORE
+	static auto module = ::LoadPackagedLibrary(_T("OPENGL32.DLL"), 0);
+#else
+	static auto module = ::LoadLibrary(_T("OPENGL32.DLL"));
+#endif
 
 	// Prevent static linking of opengl32
 	static auto wglGetProcAddress_ = reinterpret_cast<void * (__stdcall *)(const char *)>(::GetProcAddress(module, "wglGetProcAddress"));