gl view done

This commit is contained in:
Михаил Капелько committed 2026-10-20 06:50:13 +03:00
1 parent 137188e618
commit ff4613d8e6
6 files changed
+54 -45

No files matched your search

+18 -9
View File
@@ -124,22 +124,24 @@ public struct F {
public static let countText = "countText"
public static let didClickIncrement = "didClickIncrement"
public static let didLaunch = "didLaunch"
public static let didPrepareGLContext = "didPrepareGLContext"
public static let didPrepareGL = "didPrepareGL"
public static let didSetup = "didSetup"
public static let isReadyToRender = "isReadyToRender"
public static let pixelSize = "pixelSize"
public static let reshapePixelSize = "reshapePixelSize"
public static let willDeinit = "willDeinit"
}
public struct RenderContext: DialectContext {
public var backingPixelSize = [Int32]()
public var didClickIncrement = Bool()
public var didLaunch = Bool()
public var didPrepareGLContext = Bool()
public var didPrepareGL = Bool()
public var didSetup = Bool()
public var isReadyToRender = Bool()
public var pixelSize = [Int32]()
public var reshapePixelSize = [Int32]()
public var willDeinit = Bool()
public var recentField = ""
@@ -153,8 +155,8 @@ public struct RenderContext: DialectContext {
else if (name == "didLaunch") {
return didLaunch as! T
}
else if (name == "didPrepareGLContext") {
return didPrepareGLContext as! T
else if (name == "didPrepareGL") {
return didPrepareGL as! T
}
else if (name == "didSetup") {
return didSetup as! T
@@ -168,6 +170,9 @@ public struct RenderContext: DialectContext {
else if (name == "reshapePixelSize") {
return reshapePixelSize as! T
}
else if (name == "willDeinit") {
return willDeinit as! T
}
return "unknown-field-name" as! T
}
@@ -185,8 +190,8 @@ public struct RenderContext: DialectContext {
else if (name == "didLaunch") {
didLaunch = value as! Bool
}
else if (name == "didPrepareGLContext") {
didPrepareGLContext = value as! Bool
else if (name == "didPrepareGL") {
didPrepareGL = value as! Bool
}
else if (name == "didSetup") {
didSetup = value as! Bool
@@ -200,6 +205,9 @@ public struct RenderContext: DialectContext {
else if (name == "reshapePixelSize") {
reshapePixelSize = value as! [Int32]
}
else if (name == "willDeinit") {
willDeinit = value as! Bool
}
}
}
@@ -418,10 +426,11 @@ func rootRegisterShoulds(_ ctrl: DialectController) {
func renderRegisterEffects(_ ctrl: DialectController) {
let _: RenderContext? = registerOneliners(ctrl, [
F.didClickIncrement, { (c: RenderContext) in renderLoadCubeModel(RenderVM.shared!) },
F.didPrepareGL, { (c: RenderContext) in renderInit(RenderVM.shared!) },
F.didPrepareGL, { (c: RenderContext) in RenderVM.shared!.didPrepareGL = true },
F.didPrepareGL, { (c: RenderContext) in renderStartTimer(RenderVM.shared!) },
F.pixelSize, { (c: RenderContext) in RenderVM.shared!.pixelSize = c.pixelSize },
F.didPrepareGLContext, { (c: RenderContext) in renderInit(RenderVM.shared!) },
F.didPrepareGLContext, { (c: RenderContext) in RenderVM.shared!.didPrepareGLContext = true },
F.didPrepareGLContext, { (c: RenderContext) in renderStartTimer(RenderVM.shared!) },
F.willDeinit, { (c: RenderContext) in renderDeinit(RenderVM.shared!) },
])
}