Add gl_set_proc_address to both sdl2 and glfw as utility loaders for OpenGL

This commit is contained in:
gingerBill
2021-08-25 15:21:06 +01:00
parent 82facb387c
commit 1ef59417ef
2 changed files with 14 additions and 1 deletions

View File

@@ -222,4 +222,10 @@ SetCharModsCallback :: glfw.SetCharModsCallback;
SetCursorEnterCallback :: glfw.SetCursorEnterCallback;
SetJoystickCallback :: glfw.SetJoystickCallback;
SetErrorCallback :: glfw.SetErrorCallback;
SetErrorCallback :: glfw.SetErrorCallback;
// Used by vendor:OpenGL
gl_set_proc_address :: proc(p: rawptr, name: cstring) {
(^rawptr)(p)^ = GetProcAddress(name);
}

View File

@@ -304,3 +304,10 @@ foreign lib {
GL_SwapWindow :: proc(window: ^Window) ---
GL_DeleteContext :: proc(ctx: GLContext) ---
}
// Used by vendor:OpenGL
gl_set_proc_address :: proc(p: rawptr, name: cstring) {
(^rawptr)(p)^ = GL_GetProcAddress(name);
}