-
Notifications
You must be signed in to change notification settings - Fork 0
/
notes.txt
148 lines (85 loc) · 3.07 KB
/
notes.txt
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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
https://web.archive.org/web/20200301061846/http://www.thinkbottomup.com.au/site/blog/C%20%20_Mixins_-_Reuse_through_inheritance_is_good
https://www.youtube.com/watch?v=VMOsz61Hg84
Need someway of differentiated between composable classes like Panel and objects like Theme
I could do omega::Composable::Panel, omega::Composable::State omega::Composable::Button
Separate draw from io_update (can run declarative branches depending on flag)
#include <iostream>
#include "state.h"
#include "renderer_ogl.h"
// composable gui - completely generic - composable objects? - templates?
/*
compose::onFocus(T::function) {
if (mouseOver(g.mousePos, g.areaAt(T)))
T::function();
}
what does our state look like?
Vector <Window> Windows;
Console <Parent>
OutputView
InputView
SendButton
Menu <Parent>
Vector <Window> Windows;
Console - Outputview
- Inputview
- SendButton - Label
- Clicker
Menu
---- With a declarative style can we remove state?
--- What about a computation-based style?
*/
void Draw() {
/*
What does building a console look like?
Input is being collected at event time and being pushed to gui at draw
time State is being stored globally?
int count = 0;
Panel::begin();
Window::begin();
Window::setTitle("Console"); // why am i setting the title every
frame? Panel::beginChild(); VStack::Begin(); Panel::beginChild();
Text::begin();
Text::label("count", count)
Text::end();
auto ParentPos = Window::pos();
Button::begin();
//Button::move(Button::parent()::pos() + Pos(10,10));
Button::label("Increment");
Button::onClick(InputView::pressEnter);
Button::onclick(++count);
Button::end();
Panel::endChild();
VStack::End();
OutputView::begin();
//static std::vector<string> consoleLines; // one option for
maintaining state
auto threeLinesAgo = OutputView::getLine(-3);
OutputView::pushLine(threeLinesAgo);
// high light text
compose::onFocus() >> OutputView::mouseSelect() >>
compose::onMouseRelease() >> compose::pushClipboard(); OutputView::end();
InputView::begin();
// compose
compose::onFocus(InputView::listenForKeyPress());
InputView::onEnter(OutputView::pushLine);
InputView::end();
Panel::endChild();
Panel::end();
*/
}
int main() {
/*
Window::start();
Window::SetRect(300, 300, 300, 300);
Window::SetTitle("Hello!");
Window::SetMovable(true);
Window::SetKeyable(true);
Button::start();
Text::start("asdf");
Text::end();
Button::end();
Window::end();
*/
omega_test::RendererOGL renderer;
renderer.RendererQuad(50, 50, 50, 50);
}