summaryrefslogtreecommitdiffstats
path: root/osdep/macOS_mpv_helper.swift
diff options
context:
space:
mode:
authorAkemi <der.richter@gmx.de>2018-06-06 17:04:40 +0200
committerJan Ekström <jeebjp@gmail.com>2018-06-12 01:51:01 +0300
commit5865086aa84cae5e5505698ccf115a53a1b6b4fa (patch)
tree416b5ce30ae4c4d35af4130aa1956757fb6252ff /osdep/macOS_mpv_helper.swift
parent20dffe0621b3e26674850ef0b46ba3e689931d87 (diff)
downloadmpv-5865086aa84cae5e5505698ccf115a53a1b6b4fa.tar.bz2
mpv-5865086aa84cae5e5505698ccf115a53a1b6b4fa.tar.xz
cocoa-cb: remove pre-allocation of window, view and layer
the pre-allocation was needed because the layer allocated a opengl context async itself and we couldn't influence that. so we had to start the core after the context was actually allocated. furthermore a window, view and layer hierarchy had to be created so the layer would create a context. now, instead of relying on the layer to create a context we do this manually and re-use that context later when the layer wants to create one async itself.
Diffstat (limited to 'osdep/macOS_mpv_helper.swift')
-rw-r--r--osdep/macOS_mpv_helper.swift7
1 files changed, 7 insertions, 0 deletions
diff --git a/osdep/macOS_mpv_helper.swift b/osdep/macOS_mpv_helper.swift
index b023c4f098..e1fb3cf6cb 100644
--- a/osdep/macOS_mpv_helper.swift
+++ b/osdep/macOS_mpv_helper.swift
@@ -21,6 +21,12 @@ import OpenGL.GL3
let glDummy: @convention(c) () -> Void = {}
+extension Bool {
+ init(_ num: Int32) {
+ self.init(num > 0)
+ }
+}
+
class MPVHelper: NSObject {
var mpvHandle: OpaquePointer?
@@ -28,6 +34,7 @@ class MPVHelper: NSObject {
var mpvLog: OpaquePointer?
var inputContext: OpaquePointer?
var mpctx: UnsafeMutablePointer<MPContext>?
+ var macOpts: macos_opts?
var fbo: GLint = 1
init(_ mpv: OpaquePointer) {