Browse Source

Merge branch 'master' of https://github.com/odin-lang/Odin

gingerBill 2 years ago
parent
commit
d6300314c0
2 changed files with 9 additions and 1 deletions
  1. 1 0
      core/sys/windows/types.odin
  2. 8 1
      core/sys/windows/wgl.odin

+ 1 - 0
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

+ 8 - 1
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
 }