some
This commit is contained in:
1 parent
738a5bffd0
commit
47f9eb904a
30 files changed
+339
-35
No files matched your search
@@ -0,0 +1,115 @@
|
||||
version: 4
|
||||
|
||||
output:
|
||||
game/ver-mac/src/dialect.swift:
|
||||
type: swift
|
||||
|
||||
ChkgfxComponent:
|
||||
type: component
|
||||
shoulds:
|
||||
didLaunch:
|
||||
1. Only once during the first setup:
|
||||
if:
|
||||
c.recentField == F.didSetup &&
|
||||
c.didLaunch == false
|
||||
then:
|
||||
c.didLaunch = true
|
||||
|
||||
ChkgfxContext:
|
||||
type: context
|
||||
fields:
|
||||
didClickLoadModel: Bool
|
||||
didLaunch: Bool
|
||||
didSetup: Bool
|
||||
|
||||
RenderContext:
|
||||
type: context
|
||||
fields:
|
||||
backingPixelSize: [Int32]
|
||||
didClickIncrement: Bool
|
||||
didLaunch: Bool
|
||||
didPrepareGL: Bool
|
||||
didSetup: Bool
|
||||
pixelSize: [Int32]
|
||||
reshapePixelSize: [Int32]
|
||||
willDeinit: Bool
|
||||
|
||||
RenderComponent:
|
||||
type: component
|
||||
oneliners:
|
||||
- didClickIncrement: renderLoadCubeModel(RenderVM.shared!)
|
||||
- didPrepareGL: renderInit(RenderVM.shared!)
|
||||
- didPrepareGL: RenderVM.shared!.didPrepareGL = true
|
||||
- didPrepareGL: renderStartTimer(RenderVM.shared!)
|
||||
- pixelSize: RenderVM.shared!.pixelSize = c.pixelSize
|
||||
- willDeinit: renderDeinit(RenderVM.shared!)
|
||||
shoulds:
|
||||
didLaunch:
|
||||
1. Only once during the first setup:
|
||||
if:
|
||||
c.recentField == F.didSetup &&
|
||||
c.didLaunch == false
|
||||
then:
|
||||
c.didLaunch = true
|
||||
pixelSize:
|
||||
1. Upon launch:
|
||||
if:
|
||||
c.recentField == F.didLaunch
|
||||
then:
|
||||
c.pixelSize = [1, 1]
|
||||
2. Upon resize:
|
||||
if:
|
||||
c.recentField == F.reshapePixelSize
|
||||
then:
|
||||
c.pixelSize = c.reshapePixelSize
|
||||
3. Upon DPI change:
|
||||
if:
|
||||
c.recentField == F.backingPixelSize
|
||||
then:
|
||||
c.pixelSize = c.backingPixelSize
|
||||
|
||||
RootComponent:
|
||||
type: component
|
||||
oneliners:
|
||||
- countText: RootVM.shared!.countText = c.countText
|
||||
- didClickIncrement: renderSet(F.didClickIncrement, true)
|
||||
shoulds:
|
||||
count:
|
||||
1. Upon hitting 10 the first time:
|
||||
if:
|
||||
c.recentField == F.didClickIncrement &&
|
||||
c.count == 7
|
||||
then:
|
||||
c.count += 10
|
||||
2. Upon each button click:
|
||||
if:
|
||||
c.recentField == F.didClickIncrement
|
||||
then:
|
||||
c.count += 1
|
||||
countText:
|
||||
1. Upon each count change:
|
||||
if:
|
||||
c.recentField == F.count
|
||||
then:
|
||||
c.countText = "Count: '\(c.count)'"
|
||||
2. Upon launch:
|
||||
if:
|
||||
c.recentField == F.didLaunch
|
||||
then:
|
||||
c.countText = "Press the button to count"
|
||||
didLaunch:
|
||||
1. Only once during the first setup:
|
||||
if:
|
||||
c.recentField == F.didSetup &&
|
||||
c.didLaunch == false
|
||||
then:
|
||||
c.didLaunch = true
|
||||
|
||||
RootContext:
|
||||
type: context
|
||||
fields:
|
||||
count: Int
|
||||
countText: String
|
||||
didClickIncrement: Bool
|
||||
didLaunch: Bool
|
||||
didSetup: Bool
|
||||
@@ -3,13 +3,13 @@
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleName</key>
|
||||
<string>OGS Mahjong</string>
|
||||
<string>OGS chkgfx</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>OGS Mahjong</string>
|
||||
<string>OGS chkgfx</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.opengamestudio.Mahjong</string>
|
||||
<string>org.opengamestudio.chkgfx</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>ogs-mahjong</string>
|
||||
<string>ogs-chkgfx</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string>AppIcon</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
|
||||
@@ -5,7 +5,7 @@ import PackageDescription
|
||||
let raylibPrefix = ProcessInfo.processInfo.environment["RAYLIB_PREFIX"] ?? "/opt/homebrew"
|
||||
|
||||
let package = Package(
|
||||
name: "OGSMahjong",
|
||||
name: "OGSChkgfx",
|
||||
platforms: [
|
||||
.macOS(.v13)
|
||||
],
|
||||
@@ -19,7 +19,7 @@ let package = Package(
|
||||
]
|
||||
),
|
||||
.executableTarget(
|
||||
name: "ogs-mahjong",
|
||||
name: "ogs-chkgfx",
|
||||
dependencies: ["RaylibBridge"],
|
||||
path: "src",
|
||||
exclude: ["raybri"],
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import AppKit
|
||||
|
||||
final class AppDelegate:
|
||||
NSObject,
|
||||
NSApplicationDelegate
|
||||
{
|
||||
let chkgfx = ChkgfxComponent()
|
||||
let chkgfxVM = ChkgfxVM()
|
||||
let render = RenderComponent()
|
||||
let renderVM = RenderVM()
|
||||
|
||||
func applicationDidFinishLaunching(_ notification: Notification) {
|
||||
// Bring the app to the foreground
|
||||
NSApp.setActivationPolicy(.regular)
|
||||
NSApp.activate(ignoringOtherApps: true)
|
||||
|
||||
otherSetupConsoleLogging(chkgfx.ctrl, "Chkgfx")
|
||||
chkgfx.setup()
|
||||
otherSetupConsoleLogging(render.ctrl, "Render")
|
||||
render.setup()
|
||||
}
|
||||
|
||||
func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
|
||||
true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import AppKit
|
||||
import SwiftUI
|
||||
|
||||
@main
|
||||
struct ChkgfxApp: App {
|
||||
@NSApplicationDelegateAdaptor(AppDelegate.self) private var appDelegate
|
||||
|
||||
var body: some Scene {
|
||||
WindowGroup {
|
||||
ZStack {
|
||||
RenderView()
|
||||
.ignoresSafeArea()
|
||||
ChkgfxView(appDelegate.rootVM)
|
||||
}
|
||||
}
|
||||
.defaultSize(width: 640, height: 480)
|
||||
}
|
||||
}
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../../components/chkgfx/chkgfx.swift
|
||||
@@ -0,0 +1 @@
|
||||
../../../../components/chkgfx/chkgfxVM.swift
|
||||
@@ -0,0 +1 @@
|
||||
../../../../../components/chkgfx/mac/view/ChkgfxView.swift
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../../components/other/other.swift
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../../components/raybri/raybri.c
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../../components/raybri/raybri.h
|
||||
+1
@@ -0,0 +1 @@
|
||||
../../../../components/render/render.swift
|
||||
@@ -0,0 +1 @@
|
||||
../../../../components/render/renderAux.swift
|
||||
@@ -0,0 +1 @@
|
||||
../../../../components/render/renderConst.swift
|
||||
@@ -0,0 +1 @@
|
||||
../../../../components/render/renderConstShader.swift
|
||||
@@ -0,0 +1 @@
|
||||
../../../../components/render/renderEffect.swift
|
||||
@@ -0,0 +1 @@
|
||||
../../../../components/render/renderVM.swift
|
||||
@@ -0,0 +1 @@
|
||||
../../../../../components/render/mac/view/RenderGLView.swift
|
||||
@@ -0,0 +1 @@
|
||||
../../../../../components/render/mac/view/RenderView.swift
|
||||
Reference in new issue
Block a user