mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +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
|
// Used by vendor:OpenGL
|
||||||
|
// https://www.khronos.org/opengl/wiki/Load_OpenGL_Functions#Windows
|
||||||
gl_set_proc_address :: proc(p: rawptr, name: cstring) {
|
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