This commit is contained in:
Михаил Капелько committed 2026-10-21 17:51:05 +03:00
1 parent f3ea773c79
commit 70386f15b6
47 files changed
+26 -24

No files matched your search

+115
View File
@@ -0,0 +1,115 @@
version: 4
output:
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
+26
View File
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleName</key>
<string>OGS chkgfx</string>
<key>CFBundleDisplayName</key>
<string>OGS chkgfx</string>
<key>CFBundleIdentifier</key>
<string>org.opengamestudio.chkgfx</string>
<key>CFBundleExecutable</key>
<string>ogs-chkgfx</string>
<key>CFBundleIconFile</key>
<string>AppIcon</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>2.0.0</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSMinimumSystemVersion</key>
<string>11.0</string>
<key>NSHighResolutionCapable</key>
<true/>
</dict>
</plist>
+37
View File
@@ -0,0 +1,37 @@
// swift-tools-version: 5.9
import Foundation
import PackageDescription
let raylibPrefix = ProcessInfo.processInfo.environment["RAYLIB_PREFIX"] ?? "/opt/homebrew"
let package = Package(
name: "OGSChkgfx",
platforms: [
.macOS(.v13)
],
targets: [
.target(
name: "RaylibBridge",
path: "src/raybri",
publicHeadersPath: ".",
cSettings: [
.unsafeFlags(["-I", "\(raylibPrefix)/include"])
]
),
.executableTarget(
name: "ogs-chkgfx",
dependencies: ["RaylibBridge"],
path: "src",
exclude: ["raybri"],
swiftSettings: [
.unsafeFlags(["-Xcc", "-DGL_SILENCE_DEPRECATION"])
],
linkerSettings: [
.unsafeFlags([
"-L", "\(raylibPrefix)/lib",
"-lraylib"
])
]
)
]
)
+1
View File
@@ -0,0 +1 @@
../../res
+26
View File
@@ -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
}
}
+18
View File
@@ -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
View File
@@ -0,0 +1 @@
../../../../components/chkgfx/chkgfx.swift
+1
View File
@@ -0,0 +1 @@
../../../../components/chkgfx/chkgfxVM.swift
+1
View File
@@ -0,0 +1 @@
../../../../../components/chkgfx/mac/view/ChkgfxView.swift
+1
View File
@@ -0,0 +1 @@
../../../../components/other/other.swift
+1
View File
@@ -0,0 +1 @@
../../../../components/raybri/raybri.c
+1
View File
@@ -0,0 +1 @@
../../../../components/raybri/raybri.h
+1
View File
@@ -0,0 +1 @@
../../../../components/render/render.swift
+1
View File
@@ -0,0 +1 @@
../../../../components/render/renderAux.swift
+1
View File
@@ -0,0 +1 @@
../../../../components/render/renderConst.swift
@@ -0,0 +1 @@
../../../../components/render/renderConstShader.swift
+1
View File
@@ -0,0 +1 @@
../../../../components/render/renderEffect.swift
+1
View File
@@ -0,0 +1 @@
../../../../components/render/renderVM.swift
@@ -0,0 +1 @@
../../../../../components/render/mac/view/RenderGLView.swift
+1
View File
@@ -0,0 +1 @@
../../../../../components/render/mac/view/RenderView.swift