46 Commits
Author SHA1 Message Date
kornerr a52344bd10 clarify 2026-11-05 22:14:15 +03:00
kornerr 806fc92e4a some 2026-11-05 22:13:32 +03:00
kornerr 14d81266ac some 2026-11-05 17:24:08 +03:00
kornerr 005616054a move icon 2026-11-05 17:21:41 +03:00
kornerr b5772432b8 ic 2026-11-05 17:01:58 +03:00
kornerr f714cf44c4 fix build 2026-11-05 16:56:53 +03:00
kornerr d407e7f0ff set icon raw 2026-11-05 16:55:16 +03:00
kornerr 89ef340432 w sup 2026-11-05 16:47:58 +03:00
kornerr 48944131a2 try icon 2026-11-05 16:45:09 +03:00
kornerr 6cdc309b9c some 2026-11-04 23:26:20 +03:00
kornerr 8ea083bd62 some 2026-11-04 23:22:22 +03:00
kornerr a01c2590ac clarify 2026-11-04 22:47:10 +03:00
kornerr ef3b2315e7 gt 2026-11-04 22:40:44 +03:00
kornerr ad430268ef clarify 2026-11-04 22:08:10 +03:00
kornerr c31723d982 some 2026-11-04 14:29:27 +03:00
kornerr 00885409b5 clarify 2026-11-03 23:13:01 +03:00
kornerr d720803a95 ar 2026-11-03 23:10:05 +03:00
kornerr 8d4b37210b cl 2026-11-03 23:09:15 +03:00
kornerr e55cb4832f cl 2026-11-03 23:01:46 +03:00
kornerr 401a8a8d90 re 2026-11-03 23:01:06 +03:00
kornerr 35ce361b55 some 2026-11-03 23:00:32 +03:00
kornerr e1ab1e0da1 clarify 2026-11-03 22:51:59 +03:00
kornerr 3eebac0f00 fix naming for w 2026-11-03 22:49:13 +03:00
kornerr 9b76492c70 ar 2026-11-03 22:43:16 +03:00
kornerr 777f340fb8 sym 2026-11-03 22:41:49 +03:00
kornerr 9943a13d81 order 2026-11-03 22:40:26 +03:00
kornerr e208f7c7fe clarify 2026-11-03 22:39:40 +03:00
kornerr 3cbebcad23 less 2026-11-03 22:38:57 +03:00
kornerr d6c79e7e74 clrify 2026-11-03 22:33:12 +03:00
kornerr db5d548f91 git 2026-11-03 22:31:49 +03:00
kornerr 73031fb52b wz 2026-11-03 22:29:28 +03:00
kornerr d886e4a7d4 some 2026-11-03 22:24:35 +03:00
kornerr dc20313ad8 some 2026-11-03 22:24:04 +03:00
kornerr 544c74cef9 more 2026-11-03 22:23:03 +03:00
kornerr 84cb2cb4bf clarify 2026-11-03 22:21:13 +03:00
kornerr 89020fc472 clarify 2026-11-03 22:17:56 +03:00
kornerr ce5c594068 some 2026-11-03 22:13:35 +03:00
kornerr 321388b98d add windows stub 2026-11-03 21:57:07 +03:00
kornerr e4dc8bd473 clarify 2026-11-03 19:30:21 +03:00
kornerr 21a7838f7a sdk 2026-11-03 19:27:53 +03:00
kornerr 7f95816077 clarify 2026-11-03 18:02:12 +03:00
kornerr 48f10a5900 vs 2022 2026-11-03 17:50:55 +03:00
kornerr 9039188336 clarify 2026-11-03 16:01:38 +03:00
kornerr 45ce408685 w 2026-11-03 15:51:00 +03:00
kornerr 951f1bff13 some 2026-11-02 23:44:43 +03:00
kornerr 1d8ed664c4 пусто 2026-11-02 23:42:29 +03:00
21 changed files with 237 additions and 15 deletions

No files matched your search

+77 -15
View File
@@ -1,32 +1,94 @@
## Prerequisites ## Prerequisites
### macOS
* `brew install raylib`
### iOS
* `brew install xcodegen`
* ghera's [raylib-ios-xcframeworks][rzip] release unpacked and placed alongside the project
### Android ### Android
* Android Studio Quail 3 (2026.1.3) * Install Android Studio Quail 3 (2026.1.3)
### iOS
* Install Xcode 26
* Install XcodeGen
`brew install xcodegen`
* Get ghera's [raylib-ios-xcframeworks][rzip]
Unpack and place it alongside the project
### Linux ### Linux
* Ubuntu 24.04 * Install Ubuntu 24.04
* [Swiftly][swiftly] + Swift (installed by Swiftly) * Install [Swiftly][swiftly] + Swift (installed by Swiftly)
* Swift dependencies (proposed by Swiftly after Swift installation) * Install Swift dependencies (proposed by Swiftly after Swift installation)
`apt-get -y install binutils git gnupg2 libcurl4-openssl-dev libgcc-13-dev libpython3-dev libstdc++-13-dev libxml2-dev libncurses-dev libz3-dev pkg-config zlib1g-dev` `apt-get -y install binutils git gnupg2 libcurl4-openssl-dev libgcc-13-dev libpython3-dev libstdc++-13-dev libxml2-dev libncurses-dev libz3-dev pkg-config zlib1g-dev`
* CrossSwiftUI dependency * Install CrossSwiftUI dependency
`apt-get -y install libgtk-4-dev` `apt-get -y install libgtk-4-dev`
### macOS
* Install Xcode 26
* Install Raylib 6
`brew install raylib`
### Windows
![Developer mode][w11-dev-mode]
* Install Windows 11
Use x64 Windows if you want to target both Intel and ARM
* Install [Visual Studio 2022 and Swift toolchain][vs]
* Install App Runtime
`winget install --id Microsoft.WindowsAppRuntime.1.5 -e --source winget`
* Enable developer mode
Settings -> System -> Advanced -> Developer Mode: On (see the screenshot above)
* Install Git Bash
`winget install --id Git.Git -e --source winget`
While in Git Bash installation wizard, select defaults
* Inside Git Bash: configure Git to use actual symlinks
`git config --global core.symlinks true`
* Inside GitBash: find the location of `swift.exe`
```
$ find /c -name swift.exe
/c/Users/mk/AppData/Local/Programs/Swift/Toolchains/6.4.2+Asserts/usr/bin/swift.exe
```
* Inside Git Bash: to `~/.bash_profile` add Swift location (without `swift.exe`) to `PATH`
`export PATH="$PATH:/c/Users/mk/AppData/Local/Programs/Swift/Toolchains/6.4.2+Asserts/usr/bin"`
* Restart Git Bash
* Make sure Swift compiler is working
```
$ swift --version
Swift version 6.4.2 (swift-6.4.2-RELEASE)
Target: aarch64-unknown-windows-msvc
Build config: +assertions
```
## Components ## Components
| Component | macOS | iOS | Android | Linux | Windows | Description | | Component | macOS | iOS | Android | Linux | Windows | Description |
| --- | --- | --- | --- | --- | --- | --- | | --- | --- | --- | --- | --- | --- | --- |
| hp | √ | √ | √ | ? | | **h**ello-**p**latform is a simple UI to validate platform support | | hp | √ | √ | √ | √ | √ | **h**ello-**p**latform is a simple UI to validate platform support |
| hrb | | | | | | **h**ello-**r**ayli**b** is a simple raylib rendering to validate platform support |
[rzip]: https://github.com/ghera/raylib-iOS/releases/download/6.2.0-iOS/raylib-ios-xcframeworks-6.2.0-iOS.zip [rzip]: https://github.com/ghera/raylib-iOS/releases/download/6.2.0-iOS/raylib-ios-xcframeworks-6.2.0-iOS.zip
[swiftly]: https://www.swift.org/install/linux/ [swiftly]: https://www.swift.org/install/linux/
[vs]: https://www.swift.org/install/windows/
[w11-dev-mode]: docs/img/w11-dev-mode.jpg
@@ -0,0 +1,35 @@
import WinSDK
func otherSetupWindowIcon(_ iconId: Int) {
// Only visit windows owned by this UI thread, never another application's window
EnumThreadWindows(GetCurrentThreadId(), { wnd, iconId in
let resource = UnsafePointer<WCHAR>(bitPattern: Int(iconId))
let module = GetModuleHandleW(nil)
// Small icon
if let small = LoadImageW(
module,
resource,
UINT(IMAGE_ICON),
GetSystemMetrics(SM_CXSMICON),
GetSystemMetrics(SM_CYSMICON),
UINT(LR_SHARED)
) {
SendMessageW(wnd, UINT(WM_SETICON), WPARAM(ICON_SMALL), LPARAM(Int(bitPattern: small)))
}
// Large icon
if let large = LoadImageW(
module,
resource,
UINT(IMAGE_ICON),
GetSystemMetrics(SM_CXICON),
GetSystemMetrics(SM_CYICON),
UINT(LR_SHARED)
) {
SendMessageW(wnd, UINT(WM_SETICON), WPARAM(ICON_BIG), LPARAM(Int(bitPattern: large)))
}
return true
}, LPARAM(iconId))
}
+33
View File
@@ -223,3 +223,36 @@ it installs the executable, launcher and icon for the current user and refreshes
the desktop/icon caches. It requires GNU sed, gtk-update-icon-cache and the desktop/icon caches. It requires GNU sed, gtk-update-icon-cache and
update-desktop-database. The standalone `install-linux` script has been replaced update-desktop-database. The standalone `install-linux` script has been replaced
by this packaging step. by this packaging step.
## Windows (WinUI)
`ver-windows/` mirrors the Linux SwiftCrossUI target with `WinUIBackend`.
It shares the counter component and generated Swift dialect via
relative symlinks. It reuses the SwiftCrossUI model and view in `components/hp/linux`. Check out the repository with Git symlinks enabled on Windows
(Developer Mode or appropriate symlink permissions are needed).
With the Windows Swift toolchain, Windows SDK, and the Windows App SDK runtime
required by SwiftCrossUI's WinUI backend installed, run in Git Bash from `hello/hello-platform`:
```bash
util/build-windows
util/run-windows
```
The build uses the existing generated Swift dialect, like the Linux build.
The run script locates the existing debug executable without rebuilding it.
### Windows executable icon
`res/AppIcon.res` is a ready-made Windows resource containing six icon sizes
(16–256px) from the shared `res/AppIcon.png`, with icon group ID 101.
`ver-windows/res/AppIcon.res` links to it. No ICO or RC file is required by the
Windows target, and the build does not compile resources.
`step/buildWindows` exports `APP_RES_DIR` as the absolute Git Bash
`ver-windows/res` path derived from `$SDIR/../ver-windows/res`.
The entry script obtains `SDIR` with `pwd -P`;
no resource copy is needed. The manifest appends `/AppIcon.res` and passes it to the linker.
Manual SwiftPM commands that evaluate the manifest also need `APP_RES_DIR`.
Windows compilation and the live window/taskbar icon require verification on
Windows; no Windows build was performed when this wiring was added.
Binary file not shown.

After

Width:  |  Height:  |  Size: 116 KiB

+8
View File
@@ -0,0 +1,8 @@
#!/bin/bash -e
SDIR=$(cd "$(dirname "$0")" && pwd -P)
T=$SDIR/step
TARGET=hello-platform
STEP=0
source "$T/buildWindows" "$TARGET"
+8
View File
@@ -0,0 +1,8 @@
#!/bin/bash -e
SDIR=$(cd "$(dirname "$0")" && pwd -P)
T=$SDIR/step
TARGET=hello-platform
STEP=0
source "$T/runWindows" "$TARGET"
@@ -0,0 +1,9 @@
#!/bin/bash -e
TARGET=$1
STEP=$((STEP+1))
echo -e "\n> > > > Step №$STEP. Build '$TARGET' for Windows"
cd "$SDIR/../ver-windows"
export APP_RES_DIR="$SDIR/../ver-windows/res"
swift build
@@ -0,0 +1,8 @@
#!/bin/bash -e
TARGET=$1
STEP=$((STEP+1))
echo -e "\n> > > > Step №$STEP. Run Windows app for '$TARGET'"
cd "$SDIR/../ver-windows"
"./.build/debug/$TARGET.exe"
@@ -0,0 +1,25 @@
// swift-tools-version: 5.10
import Foundation
import PackageDescription
let resDir = ProcessInfo.processInfo.environment["APP_RES_DIR"]!
let package = Package(
name: "hello-platform",
dependencies: [
.package(url: "https://github.com/moreSwift/swift-cross-ui", branch: "v0.10.0")
],
targets: [
.executableTarget(
name: "hello-platform",
dependencies: [
.product(name: "SwiftCrossUI", package: "swift-cross-ui"),
.product(name: "WinUIBackend", package: "swift-cross-ui")
],
path: "src",
linkerSettings: [
.unsafeFlags(["-Xlinker", "\(resDir)/AppIcon.res"])
]
)
]
)
+1
View File
@@ -0,0 +1 @@
../../../../res/AppIcon.res
@@ -0,0 +1,16 @@
import SwiftCrossUI
import WinUIBackend
@main
struct HPApp: App {
let delegate = HPAppDelegate()
var body: some Scene {
WindowGroup("Hello platform") {
HPView(delegate.hpVM)
.onAppear {
delegate.setup()
}
}
}
}
@@ -0,0 +1,11 @@
final class HPAppDelegate {
let hp = HPComponent()
let hpVM = HPVM()
func setup() {
otherSetupConsoleLogging(hp.ctrl, "HP")
hp.setup()
otherSetupWindowIcon(101)
}
}
+1
View File
@@ -0,0 +1 @@
../../ver-mac/src/dialect.swift
+1
View File
@@ -0,0 +1 @@
../../../../../components/hp/hp.swift
+1
View File
@@ -0,0 +1 @@
../../../../../components/hp/linux/hpVM.swift
@@ -0,0 +1 @@
../../../../../../components/hp/linux/view/HPView.swift
@@ -0,0 +1 @@
../../../../../components/other/other.swift
@@ -0,0 +1 @@
../../../../../components/other/windows/otherWindows.swift
File renamed without changes.
BIN
View File
Binary file not shown.