rev: 3827f53bae88e48a594610914ba74b9512ead6dd tukan/testing/test_imgui_dock.sc -rw-r--r-- 1.3 KiB View raw Log this file
3827f53bae88 — Leonard Ritter * more work on module system 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
using import glm
using import struct
using import enum
using import ..tukan.imgui
using import ..tukan.GLMain
using import ..tukan.DockGUI
using import .testfragment
using import ..tukan.nfd

vvv bind glmain
GLMain
    title = "DockGUI"
    width = 960
    height = 540
    resizable = true

DockGUI glmain

fn shader (uv)
    vec4 0.5

global test-window-visible = true
@@ 'on DockGUI.on-define-windows
fn ()
    if test-window-visible
        ShowDemoWindow test-window-visible

@@ 'on DockGUI.on-define-main-menu
fn ()
    if (WithMenu "View")
        MenuItem "Show Demo Window"
            selected = test-window-visible

@@ 'on DockGUI.on-define-dock
fn ()
    if (WithBegin "3D")
        let size =
            GetContentRegionAvail;
        if (Button "Test")
            local target_path : (mutable rawstring)
            print
                NFD_OpenDialog "sc"
                    module-dir
                    &target_path
            print target_path
        #render-view size
        #Image
            inttoptr fbtex ImTextureID
            size = size
            uv0 =
                vec2 0.0
                    size.y / (f32 fbsize.y)
            uv1 =
                vec2
                    size.x / (f32 fbsize.x)
                    0.0

@@ 'on DockGUI.on-frame
inline (time size)
    #Button "Test"

'run glmain

drop glmain