aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgingerBill <bill@gingerbill.org>2022-12-06 19:55:24 +0000
committergingerBill <bill@gingerbill.org>2022-12-06 19:55:24 +0000
commitd6300314c036e7cfba66e002a1e8b11b9154bdfa (patch)
tree1ce4174871cf920910a18497eb28f80d2c2670b9
parent27130259cc0e9aaffed13ed7515b05ffd5e1e9cb (diff)
parentb4fb295bb3abefe705a60376cb6d0e4230be74ce (diff)
Merge branch 'master' of https://github.com/odin-lang/Odin
-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
}