mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
app,gpu/internal/opengl: move glFlush to macOS context present
A previous change[0] moved all OpenGL function calls to the internal opengl package, so that Gio can use desktop OpenGL and OpenGL ES (ANGLE) in the same program without confusing the function pointers. However the change also moved the glFlush that constitutes a buffer swap, or present, on macOS. Other platforms don't need the flush, so this change moves it back to macOS-specific code, in glContext.Present where it belongs. It also uses dlopen and dlsym to avoid symbol confusion between Apple's OpenGL framework and ANGLE's libGLESv2.dylib. The motivation is that we're getting rid of the desktop OpenGL backend on macOS in favor of Metal, and so should reduce the number of global special-cases catering to that platform. [0] https://gioui.org/commit/476d2269a Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -285,8 +285,6 @@ func (b *Backend) EndFrame() {
|
||||
b.sRGBFBO.Blit()
|
||||
}
|
||||
b.restoreState(b.savedState)
|
||||
// For single-buffered framebuffers such as on macOS.
|
||||
b.funcs.Flush()
|
||||
}
|
||||
|
||||
func (b *Backend) queryState() glState {
|
||||
|
||||
Reference in New Issue
Block a user