Files
mahjong/hello/hello-raylib/dialect.yml
T
2026-11-05 23:05:56 +03:00

91 lines
2.6 KiB
YAML

version: 4
output:
ver-mac/src/dialect.swift:
type: swift
HRBContext:
type: context
fields:
title: String
didLaunch: Bool
didSetup: Bool
HRBComponent:
type: component
oneliners:
- title: HRBVM.shared!.title = c.title
shoulds:
title:
1. Upon launch:
if:
c.recentField == F.didLaunch
then:
c.title = "hello-raylib"
didLaunch:
1. Only once during the first setup:
if:
c.recentField == F.didSetup &&
c.didLaunch == false
then:
c.didLaunch = true
RenderContext:
type: context
fields:
backingPixelSize: [Int32]
didLaunch: Bool
didPrepareGL: Bool
didPrepareMacGL: Bool
didSetup: Bool
pixelSize: [Int32]
reshapePixelSize: [Int32]
willDeinit: Bool
willRecreateSurface: Bool
RenderComponent:
type: component
oneliners:
- didPrepareGL: renderInit(RenderVM.shared!)
- didPrepareGL: RenderVM.shared!.didPrepareGL = true
- didPrepareGL: renderStartTimer(RenderVM.shared!)
- pixelSize: RenderVM.shared!.pixelSize = c.pixelSize
- willDeinit: renderDeinit(RenderVM.shared!)
- willRecreateSurface: renderRecreateSurface(RenderVM.shared!)
shoulds:
didLaunch:
1. Only once during the first setup:
if:
c.recentField == F.didSetup &&
!c.didLaunch
then:
c.didLaunch = true
didPrepareGL:
1. Upon preparing macOS OpenGL:
if:
c.recentField == F.didPrepareMacGL
then:
c.didPrepareGL = 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
willRecreateSurface:
1. Upon resize:
if:
c.recentField == F.reshapePixelSize
then:
c.willRecreateSurface = true