|
@@ -38,6 +38,7 @@ _gl_get_context :: proc(window_handle: Window_Handle) -> (GL_Context, bool) {
|
|
|
|
|
|
|
|
win32.gl_set_proc_address(&win32.wglChoosePixelFormatARB, "wglChoosePixelFormatARB")
|
|
win32.gl_set_proc_address(&win32.wglChoosePixelFormatARB, "wglChoosePixelFormatARB")
|
|
|
win32.gl_set_proc_address(&win32.wglCreateContextAttribsARB, "wglCreateContextAttribsARB")
|
|
win32.gl_set_proc_address(&win32.wglCreateContextAttribsARB, "wglCreateContextAttribsARB")
|
|
|
|
|
+ win32.gl_set_proc_address(&win32.wglSwapIntervalEXT, "wglSwapIntervalEXT")
|
|
|
|
|
|
|
|
if win32.wglChoosePixelFormatARB == nil {
|
|
if win32.wglChoosePixelFormatARB == nil {
|
|
|
log.error("Failed fetching wglChoosePixelFormatARB")
|
|
log.error("Failed fetching wglChoosePixelFormatARB")
|
|
@@ -49,6 +50,11 @@ _gl_get_context :: proc(window_handle: Window_Handle) -> (GL_Context, bool) {
|
|
|
return {}, false
|
|
return {}, false
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if win32.wglSwapIntervalEXT == nil {
|
|
|
|
|
+ log.error("Failed fetching wglSwapIntervalEXT")
|
|
|
|
|
+ return {}, false
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
pixel_format_ilist := [?]i32 {
|
|
pixel_format_ilist := [?]i32 {
|
|
|
win32.WGL_DRAW_TO_WINDOW_ARB, 1,
|
|
win32.WGL_DRAW_TO_WINDOW_ARB, 1,
|
|
|
win32.WGL_SUPPORT_OPENGL_ARB, 1,
|
|
win32.WGL_SUPPORT_OPENGL_ARB, 1,
|
|
@@ -73,6 +79,7 @@ _gl_get_context :: proc(window_handle: Window_Handle) -> (GL_Context, bool) {
|
|
|
win32.SetPixelFormat(hdc, pixel_format, nil)
|
|
win32.SetPixelFormat(hdc, pixel_format, nil)
|
|
|
ctx := win32.wglCreateContextAttribsARB(hdc, nil, nil)
|
|
ctx := win32.wglCreateContextAttribsARB(hdc, nil, nil)
|
|
|
win32.wglMakeCurrent(hdc, ctx)
|
|
win32.wglMakeCurrent(hdc, ctx)
|
|
|
|
|
+ win32.wglSwapIntervalEXT(1)
|
|
|
return ctx, true
|
|
return ctx, true
|
|
|
}
|
|
}
|
|
|
|
|
|