120 lines
4.7 KiB
Plaintext
120 lines
4.7 KiB
Plaintext
# TODOs, semi-random sorting
|
|
|
|
[x] Implement glyph draw command
|
|
[x] Implement div.view and scrollbars
|
|
[x] Port font system from C to C3 (rewrite1)
|
|
[ ] Update ARCHITECTURE.md
|
|
[ ] Write a README.md
|
|
[ ] Use an arena allocator for cache
|
|
[ ] Do not redraw if there was no update (no layout and no draw)
|
|
[ ] Do command buffer damage tracking based on a context grid (see rxi writeup)
|
|
[x] Better handling of the active and focused widgets, try
|
|
to maintain focus until mouse release (fix scroll bars)
|
|
[x] Clip element bounds to parent div, specifically text
|
|
[ ] Resizeable divs
|
|
[x] Implement a z index and sort command buffer based on that
|
|
[ ] Ctx.set_z_index()
|
|
[x] Sort command buffer on insertion
|
|
[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
|
|
[ ] Animations, somehow
|
|
[ ] Maybe cache codepoint converted strings
|
|
[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
|
|
[x] .qoi
|
|
[ ] .ff
|
|
[ ] .bmp
|
|
[ ] .png
|
|
[ ] .jpg
|
|
[ ] gif support?
|
|
[ ] layout_set_max_rows() and layout_set_max_columns()
|
|
[x] Maybe SDF sprites??
|
|
[x] Stylesheets and stylesheet import
|
|
[x] use SDF to draw anti-aliased rounded rectangles https://zed.dev/blog/videogame
|
|
[ ] Subdivide modules into ugui::ug for exported functions and ugui::core for
|
|
internal use functions (used to create widgets)
|
|
[x] The render loop RAPES the gpu, valve pls fix
|
|
[ ] 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
|
|
[ ] Border and padding do not go well together if the library issues two rect commands, the visible
|
|
border is effectively the border size plus the padding since there is a gap between the border
|
|
rect and the internal rect. A better solution is to leave it up to the renderer to draw the rect
|
|
correctly
|
|
|
|
## Layout
|
|
|
|
[x] Flexbox
|
|
[ ] For some reason padding is not correct, look at the sliders, they have 2px per side when the
|
|
theme specifies 4px per side
|
|
[ ] Center elements to the row/column
|
|
[ ] Text wrapping / reflow
|
|
[ ] Consider a multi-pass recursive approach to layout (like https://github.com/nicbarker/clay)
|
|
instead of the curren multi-frame approach.
|
|
|
|
## 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
|
|
|
|
## Commands
|
|
|
|
[x] rect commads should have:
|
|
- border width
|
|
- border radius
|
|
[x] add a command to update an atlas
|
|
[ ] New window command, useful for popups
|
|
[ ] 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) -> ...
|
|
|
|
## Atlas
|
|
|
|
[ ] Add an interface to create, destroy, update and get atlases based on their ids
|
|
[ ] Implement multiple font atlases
|
|
[ ] Pixel format conversion
|
|
|
|
## Fonts
|
|
|
|
[x] Fix the missing alpha channel
|
|
[x] Fix the alignment
|
|
|
|
## Widgets
|
|
|
|
[x] Dynamic text box to implement an fps counter
|
|
[x] Button with label
|
|
[x] Text Input box
|
|
[ ] Icon Buttons
|
|
[x] Switch
|
|
[x] Checkbox
|
|
[ ] Selectable text box
|
|
|
|
## Main / exaple
|
|
|
|
[ ] Create maps from ids to textures and images instead of hardcoding them
|
|
|
|
|
|
## 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.
|
|
|
|
## SDL3 Renderer
|
|
|
|
[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 |