mirror of
https://github.com/odin-lang/Odin.git
synced 2025-12-29 17:34:34 +00:00
sys/windows: fix wgl function loading in accordance with OpenGL wiki
This commit is contained in:
@@ -87,6 +87,12 @@ 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)
|
||||
if uintptr(func) == 0 || uintptr(func) == 1 || uintptr(func) == 2 || uintptr(func) == 3 || uintptr(func) == ~uintptr(0) {
|
||||
module := LoadLibraryW(L("opengl32.dll"))
|
||||
func = GetProcAddress(module, name)
|
||||
}
|
||||
(^rawptr)(p)^ = func
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user