430
|
1 import std/unicode
|
|
2
|
|
3 import semicongine
|
|
4
|
|
5
|
|
6 proc main() =
|
|
7 # setup engine
|
|
8 var engine = initEngine("Test panels")
|
|
9 engine.initRenderer([])
|
|
10
|
|
11 # build scene
|
|
12 var scene = Scene(name: "main")
|
431
|
13 var panel = Panel(position: newVec2f(0, 0), size: newVec2f(0.1, 0.1))
|
430
|
14
|
|
15 scene.add panel
|
|
16 engine.loadScene(scene)
|
|
17
|
|
18 while engine.updateInputs() == Running and not engine.keyIsDown(Escape):
|
|
19 if engine.windowWasResized():
|
|
20 var winSize = engine.getWindow().size
|
|
21 panel.aspect_ratio = winSize[0] / winSize[1]
|
|
22
|
|
23 engine.renderScene(scene)
|
|
24 engine.destroy()
|
|
25
|
|
26
|
|
27 when isMainModule:
|
|
28 main()
|