ugui.c3l/TODO

127 lines
5.3 KiB
Plaintext
Raw Normal View History

2024-11-02 09:41:37 +01:00
# TODOs, semi-random sorting
2024-12-16 13:54:53 +01:00
2024-12-11 01:14:14 +01:00
[x] Implement glyph draw command
[x] Implement div.view and scrollbars
2024-12-16 13:54:53 +01:00
[x] Port font system from C to C3 (rewrite1)
2024-11-02 09:41:37 +01:00
[ ] Update ARCHITECTURE.md
[ ] Write a README.md
2024-11-21 00:50:25 +01:00
[ ] Use an arena allocator for cache
2024-12-12 15:46:40 +01:00
[ ] Do not redraw if there was no update (no layout and no draw)
2024-12-25 12:30:35 +01:00
[ ] Do command buffer damage tracking based on a context grid (see rxi writeup)
2024-12-20 20:58:12 +01:00
[x] Better handling of the active and focused widgets, try
2024-12-16 13:54:53 +01:00
to maintain focus until mouse release (fix scroll bars)
2024-12-19 15:27:14 +01:00
[x] Clip element bounds to parent div, specifically text
2024-12-20 20:58:12 +01:00
[ ] Resizeable divs
2025-07-07 11:46:40 +02:00
[x] Implement a z index and sort command buffer based on that
2025-05-05 16:23:26 +02:00
[ ] Ctx.set_z_index()
2025-07-07 11:46:40 +02:00
[x] Sort command buffer on insertion
2025-07-13 20:08:18 +02:00
[x] Standardize element handling, for example all buttons do almost the same thing, so write a lot
of boiler plate and reuse it
[x] The id combination in gen_id() uses an intger division, which is costly, use another combination
function that is non-linear and doesn't use division
2024-12-23 15:50:09 +01:00
[ ] Animations, somehow
2025-07-14 12:59:07 +02:00
[x] Maybe cache codepoint converted strings
2024-12-25 12:30:35 +01:00
[x] Fix scroll wheel when div is scrolled
[ ] Be consistent with the initialization methods some are foo.new() and some are foo.init()
[ ] Implement image loading (.bmp, .ff, .qoi and .png), in the future even lossy images like .jpg
2025-01-30 19:38:53 +01:00
[x] .qoi
[ ] .ff
[ ] .bmp
[ ] .png
[ ] .jpg
[ ] gif support?
[ ] layout_set_max_rows() and layout_set_max_columns()
2025-02-04 22:40:44 +01:00
[x] Maybe SDF sprites??
2025-07-07 11:46:40 +02:00
[x] Stylesheets and stylesheet import
[x] use SDF to draw anti-aliased rounded rectangles https://zed.dev/blog/videogame
2025-02-04 22:40:44 +01:00
[ ] Subdivide modules into ugui::ug for exported functions and ugui::core for
2025-02-03 23:07:14 +01:00
internal use functions (used to create widgets)
2025-07-07 11:46:40 +02:00
[x] The render loop RAPES the gpu, valve pls fix
2025-05-05 16:23:26 +02:00
[ ] The way the element structures are implemented wastes a lot of memory since
each struct Elem, struct Cmd, etc. is as big as the largest element. It would
be better to use a different allcation strategy.
[ ] Add a way to handle time events like double clicks
2025-07-13 20:08:18 +02:00
[x] Fix how padding is applied in push_rect. In CSS padding is applied between the border and the
content, the background color is applied starting from the border. Right now push_rect() offsets
the background rect by both border and padding
2025-07-14 12:59:07 +02:00
[ ] Investigate why the debug pointer (cyan rectangle) disappears...
2024-12-25 12:30:35 +01:00
## Layout
2024-12-26 22:58:24 +01:00
[x] Flexbox
2024-12-25 12:30:35 +01:00
[ ] Center elements to the row/column
2025-07-10 11:05:39 +02:00
[x] Text wrapping / reflow
[x] Implement a better and unified way to place a glyph and get the cursor position, maybe with a struct
[ ] Correct whitespace handling in text (\t \r etc)
2025-05-05 16:23:26 +02:00
[ ] Consider a multi-pass recursive approach to layout (like https://github.com/nicbarker/clay)
instead of the curren multi-frame approach.
2025-07-14 12:59:07 +02:00
[ ] Implement column/row sizing (min, max)
[ ] Find a way to concile pixel measurements to the mm ones used in css, for example in min/max sizing
of elements
[ ] Center elements to div (center children_bounds to the center of the div bounds and shift the origin accordingly)
[x] Use containing_rect() in position_element() to skip some computing and semplify the function
[x] Rename position_element() to layout_element()
2025-07-14 12:59:07 +02:00
[ ] Make functions to mark rows/columns as full, to fix the calculator demo
2024-12-25 12:30:35 +01:00
## Input
[x] Keyboard input
[x] Mouse scroll wheel
[ ] Touch input
[x] Do not set input event to true if the movement was zero (like no mouse movement)
[ ] Use input event flags, for example to consume the input event
2025-07-10 11:05:39 +02:00
[ ] Fix bug in text box: when spamming keys you can get multiple characters in the text input field
of the context, this causes a bug where only the first char is actually used
2024-12-11 01:14:14 +01:00
## Commands
2024-12-16 13:54:53 +01:00
2024-12-12 15:46:40 +01:00
[x] rect commads should have:
2025-06-07 10:35:08 +02:00
- border width
- border radius
2024-12-11 01:14:14 +01:00
[x] add a command to update an atlas
2024-12-20 20:58:12 +01:00
[ ] New window command, useful for popups
2025-07-10 11:05:39 +02:00
[x] Text command returns the text bounds, this way we can avoid the pattern
draw_text(a, pos) -> off = compute_bounds(a) -> draw_text(b, pos+off) -> ...
2025-07-14 12:59:07 +02:00
[ ] Rounded rectangle with different radius for each corner
2024-12-11 01:14:14 +01:00
2025-05-05 16:23:26 +02:00
## Atlas
2024-12-16 13:54:53 +01:00
2024-12-11 01:14:14 +01:00
[ ] Add an interface to create, destroy, update and get atlases based on their ids
[ ] Implement multiple font atlases
2025-05-05 16:23:26 +02:00
[ ] Pixel format conversion
2024-12-11 01:14:14 +01:00
## Fonts
2024-12-16 13:54:53 +01:00
[x] Fix the missing alpha channel
2024-12-13 16:44:07 +01:00
[x] Fix the alignment
2024-12-12 15:46:40 +01:00
## Widgets
2024-12-16 13:54:53 +01:00
2024-12-19 15:27:14 +01:00
[x] Dynamic text box to implement an fps counter
2024-12-20 20:58:12 +01:00
[x] Button with label
2025-07-07 11:46:40 +02:00
[x] Text Input box
2024-12-20 20:58:12 +01:00
[ ] Icon Buttons
2025-02-07 23:46:21 +01:00
[x] Switch
2025-02-04 22:40:44 +01:00
[x] Checkbox
2025-05-05 16:23:26 +02:00
[ ] Selectable text box
## API
[ ] Introduce a Layout structure that specifies the positioning of elements inside
a Div element. This would allow specifying alignment, maximum and minimum sizing
margins between children, etc.
This is different from style which is applied per-element.
[ ] Remove Ids for element that don't need them. Such elements are button, toggles,
and all elements which do not have internal data that has to be cached and/or
queried by the user for later use. This allows for smaller caches and in general
reduces some load, since most of the stuff is recomputed for every frame.
2025-06-07 10:35:08 +02:00
## SDL3 Renderer
2025-07-07 11:46:40 +02:00
[x] smart batching
[x] maybe use instancing since we are always drawing the same geometry. With instancing every
different quad could have its coulour, border and radius with much better performance than
issuing a draw call for every quad (and uploading it)
https://rastertek.com/dx11win10tut48.html
https://www.braynzarsoft.net/viewtutorial/q16390-33-instancing-with-indexed-primitives
[ ] implement min and max fps