keep gl view in VM
This commit is contained in:
1 parent
df4ac26658
commit
3d19b2e980
2 files changed
+2
-1
No files matched your search
@@ -6,7 +6,7 @@ import SwiftUI
|
||||
/// Render view for SwiftUI
|
||||
struct RenderView: NSViewRepresentable {
|
||||
func makeNSView(context: Context) -> RenderGLView {
|
||||
RenderGLView(frame: .zero)
|
||||
RenderVM.shared!.glView
|
||||
}
|
||||
|
||||
func updateNSView(_ nsView: RenderGLView, context: Context) {}
|
||||
|
||||
@@ -2,6 +2,7 @@ import Combine
|
||||
import Foundation
|
||||
|
||||
final class RenderVM: ObservableObject {
|
||||
let glView = RenderGLView(frame: .zero)
|
||||
var timer: Timer?
|
||||
|
||||
static private(set) weak var shared: RenderVM?
|
||||
|
||||
Reference in new issue
Block a user