app/internal/wm: [macOS] use NSView+NSOpenGLContext, not NSOpenGLContextView

NSOpenGLContextView couples the window manager logic tightly with
OpenGL. Use generic NSViews, and attach NSOpenGLContext just like the
other platforms.

This change prepares for supporting GPU contexts created by clients as
well as a future Metal port.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2021-05-14 16:48:14 +02:00
parent fcca1c11ee
commit 1d4bf04aa1
6 changed files with 170 additions and 126 deletions
+4
View File
@@ -55,6 +55,10 @@ type FrameEvent struct {
type Callbacks interface {
SetDriver(d Driver)
Event(e event.Event)
// Func runs a function during an Event. This is required for platforms
// that require coordination between the rendering goroutine and the system
// main thread.
Func(f func())
}
type Context interface {