Skip to content

Commit cdb8f4f

Browse files
committed
[git] improved
1 parent cad4a3e commit cdb8f4f

File tree

1 file changed

+42
-1
lines changed

1 file changed

+42
-1
lines changed

README.md

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,51 @@ EKG is a descriptor-based low-latency modular UI-toolkit for desktop-apps, mobil
55
Platforms: SDL2, GLFW.
66
GPU APIs: OpenGL3+, OpenGLES3.
77

8-
**Note: EKG is not stable yet.**
8+
EKG is under a experimental-buildable-unstable version, which means no ready-prod release was made before.
99

1010
## GUIs with EKG
1111

12+
### Initializing
13+
14+
This is an example for SDL2 and OpenGL 4.5, for a complete desired program, [looks here](https://github.com/vokegpu/ekg-sandbox).
15+
16+
```cpp
17+
ekg::ft_library ft_library {};
18+
FT_Init_FreeType(&ft_library);
19+
20+
ekg::runtime_properties_info_t runtime_properties_info {
21+
.default_font_path_text = "./comic-mono.ttf",
22+
.default_font_path_emoji = "./twemoji.ttf",
23+
.p_platform_base = new ekg::sdl2(app.p_sdl_win),
24+
.p_gpu_api = new ekg::opengl(),
25+
.ft_library = ft_library
26+
};
27+
28+
ekg::runtime_t ekg_runtime {};
29+
ekg::init(
30+
runtime_properties_info,
31+
&ekg_runtime
32+
);
33+
```
34+
35+
### Widgets
36+
37+
A simple frame using the basic of `ekg::make<t>`!
38+
```cpp
39+
ekg::stack_t meow {
40+
.tag = "moo"
41+
};
42+
43+
ekg::frame_t frame_template {
44+
.tag = "meows",
45+
.rect = {20.0f, 20.0f, 200.0f, 200.0f},
46+
.drag = ekg::dock::top,
47+
.resize = ekg::dock::left | ekg::dock::right | ekg::dock::bottom
48+
};
49+
50+
auto &my_frame = ekg::make<ekg::frame_t>(frame_template);
51+
````
52+
1253
## Contributing
1354

1455
Contributing for EKG is nicely welcome, please confer [EKG docs and read the model architecture](https://github.com/vokegpu/ekg-docs?tab=readme-ov-file#ekg-technical-details) for prevent ~useless~ pull requests.

0 commit comments

Comments
 (0)