aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--core/sys/windows/types.odin1
-rw-r--r--core/sys/windows/wgl.odin9
2 files changed, 9 insertions, 1 deletions
diff --git a/core/sys/windows/types.odin b/core/sys/windows/types.odin
index 430fbb329..9a2a21070 100644
--- a/core/sys/windows/types.odin
+++ b/core/sys/windows/types.odin
@@ -1261,6 +1261,7 @@ SWP_ASYNCWINDOWPOS :: 0x4000 // same as SWP_CREATESPB
CSIDL_APPDATA :: 0x001a // <user name>\Application Data
CSIDL_COMMON_APPDATA :: 0x0023 // All Users\Application Data
+CSIDL_PROFILE :: 0x0028 // <user name>\
HWND_TOP :: HWND( uintptr(0)) // 0
HWND_BOTTOM :: HWND( uintptr(1)) // 1
diff --git a/core/sys/windows/wgl.odin b/core/sys/windows/wgl.odin
index e91463a3c..77cff2fa9 100644
--- a/core/sys/windows/wgl.odin
+++ b/core/sys/windows/wgl.odin
@@ -87,6 +87,13 @@ foreign Opengl32 {
}
// Used by vendor:OpenGL
+// https://www.khronos.org/opengl/wiki/Load_OpenGL_Functions#Windows
gl_set_proc_address :: proc(p: rawptr, name: cstring) {
- (^rawptr)(p)^ = wglGetProcAddress(name)
+ func := wglGetProcAddress(name)
+ switch uintptr(func) {
+ case 0, 1, 2, 3, ~uintptr(0):
+ module := LoadLibraryW(L("opengl32.dll"))
+ func = GetProcAddress(module, name)
+ }
+ (^rawptr)(p)^ = func
}