Commit Graph

252 Commits

Author SHA1 Message Date
Ed_
425a642fd3 Started to setup input events based off sokol
Will replace the input polling done with raylib.

Going to also provide the more robust input tracking for consuming events with the UI interactions
2024-06-17 03:35:53 -04:00
Ed_
05ffaf432d VEFontCache: got rid of elf hash using a "label" hash borrowed from the rad debugger
There was an issue with uniqueness so I just decided to scrap it (no need to keep parity with the original there...)
2024-06-17 01:24:03 -04:00
Ed_
b1927a8461 optimize_draw_list now produces parity optimization to original 2024-06-16 10:27:58 -04:00
Ed_
000d46cd73 misc fixes, trying to get parity optimizatin to original VEFontCache
still not getting the pass reduction to be equivalent...
2024-06-16 08:57:06 -04:00
Ed_
9cc5d85b01 fix for draw optimization 2024-06-16 08:56:24 -04:00
Ed_
964c6c852d Fixes to shape cache and atlas region math 2024-06-16 08:56:06 -04:00
Ed_
fd3bb65aaf fixes to LRU font cache 2024-06-16 08:54:37 -04:00
Ed_
65be3eae03 More bug fixing, All latin characters don't look corrupt anymore
HMapChained causes memory corruption in VEFontCache (not sure why yet), so I switched temporarily over to HMapZPL.

Fixed bug with parser_get_glyph_shape from me tracking vertices as u16s instead of i16s.

Currently a bug with the frametime example:
text_test_str := str_fmt("frametime: %0.2f", frametime_avg_ms)

It doesn't handle per-frame updates properly compared to C++ source
2024-06-15 14:53:26 -04:00
Ed_
13f24b4ae9 More fixes, more letters 2024-06-15 08:20:58 -04:00
Ed_
5f09c22f11 Finally got a letter on the screen with the VEFontCache port 2024-06-15 04:29:10 -04:00
Ed_
569ce5ce99 still diagnosing... 2024-06-15 02:08:29 -04:00
Ed_
87bc31636e lots of corrections to VEFontCache, still no letters on screen
Something is either wrong with the sokol_gfx rendering setup or its a really dumb checkbox/uv value
2024-06-14 17:00:06 -04:00
Ed_
3b9e08794a More progress toward VEFontCache rendering
Based off of render doc, most likely down to UV issues for where on the glyph buffer the shape is located
2024-06-14 03:13:47 -04:00
Ed_
bcb684e140 Renders to glyph and I think the atlas targets (but not the screen) 2024-06-13 20:44:10 -04:00
Ed_
7ec00edfbd render doc nows shows the lettter... 2024-06-13 19:44:55 -04:00
Ed_
3402701f99 fix bug with outside bunds calc for VEFontCache.cache_glyph 2024-06-13 18:35:32 -04:00
Ed_
314582b225 Changes while attempting to debug 2024-06-13 18:25:11 -04:00
Ed_
692ca3a577 sokol gfx bug fixing for the pass/pipeline log errors (still black screen) 2024-06-13 13:58:23 -04:00
Ed_
5bd6519b6a Bugfixing the runtime (rendering not working yet) 2024-06-11 22:20:30 -04:00
Ed_
82e7482c85 Finished first draft for VEFontCache font provider hookup for sokol_gfx (untested) 2024-06-09 21:39:49 -04:00
Ed_
93368a40ff Changed new shapers' namespace to just ve 2024-06-06 16:19:53 -04:00
Ed_
4a931dcbe5 Setup shaders for text rendering based on VEFontCache samples 2024-06-06 16:15:57 -04:00
Ed_
a81019d2a5 Decided against the mapping of parser and shaper infos
Parser and shaper should just be intrusive to w/e uses them adding a map directions slows things down for no reason..
2024-06-06 10:19:20 -04:00
Ed_
71e8fadcab VEFontCache: Initial hookup to sectr module & runtime bugfixes 2024-06-06 01:07:23 -04:00
Ed_
38be79d7a9 VEFontCache: runtime bugfixes 2024-06-06 00:43:18 -04:00
Ed_
566a90001b Finished draft porting pass for VE Font Cache (next is hook to sokol_gfx + runtime testing) 2024-06-05 19:52:25 -04:00
Ed_
d469fd53e8 progress on VEFontCache port 2024-06-05 13:27:34 -04:00
Ed_
991e7a81c0 Progress on VEFontCache port, only cache_glyph_to_atlas & shape_text_uncached left 2024-06-04 18:44:12 -04:00
Ed_
26e53bf327 VEFC: ported decide_codepoint_region 2024-06-04 13:30:30 -04:00
Ed_
38ebed8874 VEFC: Added bad edge case to handle parsing conic curves, progess on cache_glyph 2024-06-03 21:08:12 -04:00
Ed_
c182ab7173 An attempt at doing a freetype outline to the stbtt shape verts 2024-06-03 19:37:09 -04:00
Ed_
1741532d64 Progress on VEFontCache port, working on freetype outline to stbtt shape 2024-06-03 17:43:15 -04:00
Ed_
26ad2d1e49 VEFontCache : Finished porting the LRU 2024-06-03 01:04:24 -04:00
Ed_
f99157aae5 Starting the process of porting VEFontCache 2024-06-02 17:29:44 -04:00
Ed_
33ddd420b7 Progress on porting fontstash 2024-06-02 17:29:27 -04:00
Ed_
9ba718254c lifted the hash maps and the string cache to the grime package 2024-05-31 20:51:30 -04:00
Ed_
e84ec719b3 Progress on lifting the 'grime' module to its own package 2024-05-31 19:31:27 -04:00
Ed_
d63242ac9c Some progress on fontstash 2024-05-31 19:31:08 -04:00
Ed_
f415eada0d Doing some heavy refactors on the container interfaces
Trying to set up their use to be more ideomatic to the core containers
2024-05-31 17:58:18 -04:00
Ed_
3db403017e Lifted fontstash to its own package, made packages for RFont and VEFontCache
Going to do fonstash first then rfont ports.

After will complete the VEFontCache port
2024-05-31 13:04:52 -04:00
Ed_
300727198b made empty files for the projection parsers
Planning to isolate the implementation into a separate package

Eventually the UI and Font handling will also be.
2024-05-31 11:28:24 -04:00
Ed_
3998776f4b Beginning to lift the "grime" files to their own pacakge 2024-05-31 11:26:52 -04:00
Ed_
0b74a8115e Minor cleanup to current bad impl of font rendering
Just trying to really "get" sokol_gfx.h
2024-05-31 11:25:27 -04:00
Ed_
64e56485fa remove .bkup of the learngl shader as its no longer needed 2024-05-30 13:18:28 -04:00
Ed_
936c0100ba Got text rendering to work with sokol_gfx (learngl text rendering article #1)
Need to todo the altas article next then the optimizing vod
2024-05-30 13:06:51 -04:00
Ed_
c681370d8b Just restore some code that I deleted from the raylib font provider file. 2024-05-26 13:58:55 -04:00
Ed_
5c2f55148a zpl_hmap prefix to hmap_zpl, plus some todos to go back to builtin containers 2024-05-26 13:35:08 -04:00
Ed_
469fa5f8ec Fixed hot-reload for sokol 2024-05-26 13:33:54 -04:00
Ed_
bb06d3b44e Don't poll input (we need to gut raylib's and switch over to sokol) 2024-05-26 12:24:11 -04:00
Ed_
0d2c5e478b Don't reload font_provider_data's cache (since we don't have that swapped yet) 2024-05-26 12:23:50 -04:00
Ed_
797ab227e9 Gut raylib usage from the codebase.
Going to either fully commit to sokol or if it fails, rolling the platform layer myself.
2024-05-25 11:52:23 -04:00
Ed_
13c3032dba Initial setup of sokol_gfx to replace the raylib impl for rendering.
Next I need to setup sokol_gp
2024-05-24 16:31:22 -04:00
Ed_
cf81d3f9bd Renamed str_fmt_alloc to str_fmt, str_fmt to str_fmt_out, allocator convention enforcement in context
I'm enforcing aprintf it as the default formatter.
I changed up the context allocator assignment to reflect how I've been intending to allocation in startup & platform events vs tick.
Tick uses the frame slab's by default with transient on temp. Startup & platform events use the transient by default & for temp, with any use of the persistent allocator being explicit.
2024-05-22 17:13:56 -04:00
Ed_
368abefccf Restored some of the window awareness previously avail in raylib for the new sokol layer.
Switched frametime_delta32 to frametime_avg_ms.

I'll problably rename it and keept delta32 for actual delta. Reading over the sokol_app code I noticed it uses the avg frametime and definitely want to do that for spike alleviation...
2024-05-22 15:39:19 -04:00
Ed_
8130faa6ad got the sokol_app library starting up and ticking!
Now I just need to get the events and rendering and fonts and... all hooked up
2024-05-22 03:44:14 -04:00
Ed_
9cd0692e56 Got it to compile with sokol changes (UNTESTED) 2024-05-22 03:28:22 -04:00
Ed_
405716e52b Mostly reviewing progress so far
Prepping in the background for swapping raylib with sokol.
2024-05-21 23:35:36 -04:00
Ed_
31bc207c75 Fixed the layout boxes & resize handles anchors & alignemnts 2024-05-21 11:50:53 -04:00
Ed_
17859a5eb9 Hopefully last design change to auto-layout algorithim
I'm sticking with not supporting the top-left alignment for default and instead going with bottom left.
This allows for 0,0 alignment to the "bottom left pivot" for a box and 1,1 to the "top-right pivot" of a box.
These naturally coincide with where the actual min-max points that define the box are for the coodrindate convention I decided to go with. I'll write docs to migitate confusion.

Now I just need to fix the layout presets I have for the currently existing constructions...
2024-05-21 11:06:51 -04:00
Ed_
e5be246d30 Cleanup and setup of drop down widget
Got an initial variant of the drop down widget, not completely set on it..
I put some more time to figuring out how I'm going to be ideomatically constructing the widgets. screen.odin I think its getting pretty close to what it will be like.
I'm ready to start lifting the input box. I'll be adding the constraints when I lift it.

Added the option to toggle the debug text in screenspace
Added the fixes from the ui_layout_children_horizontally for margins to ui_layout_children_vertically

Known issue:
There is a bug with test_whitespace that forced me todo a null check on a box. Not sure why.
It needs to be redone anyway.. (compose it with the h/vboxes instead)

There is some sublime files added in, started to use it.
2024-05-20 22:05:52 -04:00
Ed_
cdfc3d65bb Added sokol library to thirdparty
Going to get sokol_gp soonish
Need to look into figuring out text rendering...

I'm preemtively getting this stuff now but I problably won't be swapping raylib impl anytime soon.
2024-05-19 14:04:54 -04:00
Ed_
275ffcf143 Got the first 'input box' to work. Did some changes to keyboard input
Renamed KeyboardKey to KeyCode, redid the encoding layout (preemtively getting ready for SDL later as well)

I got the input box working but it has no constraints and needs to be lifted. The scroll box construction does as well.
2024-05-19 11:06:09 -04:00
Ed_
b137bc542c WIP: Stuff related to working on the settings menu + more
Moved core ui to its own folder.
Worked on theming (proper light and dark theme)
Began to work on the scroll box widget and input box constructions

I added back a script for flattening the codebase: gen_flattened_codebase.ps1
2024-05-19 01:21:51 -04:00
Ed_
ddff1fcae6 typos and buildscript fixes & additions 2024-05-16 18:16:14 -04:00
Ed_
b30f3c3466 Restructured the codebase yet again but this time with compiler support for monlithic packages
So no need to stage generate symbolic links in a flat directory for the compiler
2024-05-16 17:27:48 -04:00
Ed_
40ffed9538 Changed codebase to be foldered (breaking compiler's conventions)
I now generate the layout the compiler wants, eventually I'll just have a custom policy so that the compiler can accept the non-idiomatic layout

See scripts/build.ps1 & gen_staged_compiler_codebase.ps1 for how this is handled.
2024-05-16 13:18:27 -04:00
Ed_
5ceef39410 Some general refactors and compaction
Made a distinction from the "core" ui vs the rest of the ui that composes from there.
2024-05-16 11:21:07 -04:00
Ed_
7250456db5 Got centered resize working for the handles
Impl feels jank... but thats what I get for supporting two origins for the auto-layout
2024-05-16 02:14:54 -04:00
Ed_
85cf9d8db2 More progress on themes + workspace resize handles support
Still need to add support for centered resize of boxes with the handles. (Will need a different alignment configuration)

Theme manipulation is getting cleaned up iteratively code is slowly looking less nosiy
2024-05-15 18:48:20 -04:00
Ed_
48ee98f22d detached head bullshit 2024-05-15 03:44:18 -04:00
Ed_
af757cfdaa Began working on a proper default theme
Going with dark mode at first,
I'll also be making a lightmode, but I want to have a post-processing shader for tonemapping the app screen's tone by the user before doing so.
2024-05-15 03:37:00 -04:00
Ed_
fd2552a82f improve layout visibile lag to none for vbox & hbox on the settings menu 2024-05-14 21:54:12 -04:00
Ed_
a29632daea Fix for DLL_NodeFL 2024-05-14 14:50:38 -04:00
Ed_
70b13ce107 fixes for hmap_chained_init and other stuff 2024-05-14 14:07:29 -04:00
Ed_
26771ff2fd made a new hashtable container: HMapChained
Will be used isntead of the zpl in some places
2024-05-14 11:47:44 -04:00
Ed_
12c99bee26 Mostly cleanup
Text is athe biggest bottleneck right now. Raylib as a renderer fails for this prototype in that front.

I'll eventually need to look into other solutions such as SDL2 + something that renders UI boxes & text very fast...
2024-05-13 21:53:08 -04:00
Ed_
adc75f6977 Got support for persistent ordering of UI_Boxes using UI_FloatingManager 2024-05-13 16:07:49 -04:00
Ed_
0744069b0d pushing what I have rn, decided not to go this route
Instead going with ![img](https://i.imgur.com/S3tjZUu.png)
2024-05-13 10:40:29 -04:00
Ed_
e8c3312b69 more progress... 2024-05-13 01:56:39 -04:00
Ed_
595de438af WIP: Persistent order support for rooted boxes (top-most boxes)
I wasn't expecting it to be this to bad to support it...

Also:
* I renamed some of the files to group better with the virtual codebase view
2024-05-13 01:53:19 -04:00
Ed_
1b32fe916e Large refactor of the entire codebase
Saw that layout really should be separated from the style struct, so went ahead and pulled the trigger...
A bunch of other refactors have also been done

* Lifted layout out of style, its not separate in UI_Box and in UI_State there is not a UI_LayoutCombo stack.
* UI_StyleTheme renamed to UI_StyleCombo
* UI_Theme has both UI_StyleCombo & UI_LayoutCombo
* Made files for the "project" related code
* ui_layout_compute moved to its own file, ui_layout now used for layout related data structures and interfacing
* Impovements to horizontal & vertical box impl
* UI_Box now keeps track of how many ancestors it has
2024-05-11 22:38:05 -04:00
Ed_
6a4f7ac6de minor changes, prepping for next tasks 2024-05-11 01:30:54 -04:00
Ed_
e40e3ddf85 small refactors for organization 2024-05-10 19:50:37 -04:00
Ed_
2b1565e35b AppUI lifted to its own file, Got horizontal and vertical boxes working 2024-05-10 19:20:50 -04:00
Ed_
5b24e591eb Fixed issue with ui_signal_from_box
Biggest win was getting the intial fixes for overlapping boxes.
Eventually I'll need to add support for sorting actives of top-most ancestors
(pretty much just remove from linked list and add to last position (adjust indices of adjacent and new top most, etc)
2024-05-10 04:16:04 -04:00
Ed_
1afe74b4b5 Some cleanup, resize handles lifted to ui_resizeable_handles
Fixed some bugs with the handles as well. Old cruft for resizing was removed.
2024-05-10 02:08:36 -04:00
Ed_
a2b6325b5b coordinate space math fixes, got resize handles working in settings menu prototype
will eventually lift to its own generic widget

I still need to implement the corner resize..
2024-05-09 04:02:33 -04:00
Ed_
b8e8e7c88a Progress on setting up app's UI and horizontal/vertical box widgets 2024-05-08 02:26:39 -04:00
Ed_
e282397bf0 Nvm, took me way to long to realize the string cache needs a different hastable
This hashtable is not tolerant over going 'over capacity'. I have to eventually swap to another solution similar to Ryans linear probing for string caching.
For now I'll just abuse ram with an oversized table.
2024-05-07 01:34:43 -04:00
Ed_
3336ab2e1c Its the pool free lists... 2024-05-07 01:16:02 -04:00
Ed_
059a63ccbb Fixed issues with logging on the memory tracker 2024-05-07 01:12:02 -04:00
Ed_
1e6e9581c3 Bug fixes to allocators and containers
Still haven't found the main bug with resizing zpl_hashmap on string interning
2024-05-06 23:29:47 -04:00
Ed_
0e27635a9b Updates to readme 2024-05-04 12:59:08 -04:00
Ed_
046d79c9bd Attempt to add example vod 2024-05-04 12:10:30 -04:00
Ed_
f27a69de9a Get the project to compile once again. 2024-05-04 11:47:21 -04:00
Ed_
4492ca3079 Corrections to ols config, moved ols out of repo
ols is now assumed to exist installed by the user
2024-05-04 08:26:52 -04:00
Ed_
7162c5a14d last state of the prototype.
* Still has memory issue
* Was last using it to learn some PGA from Lengyel's books
2024-04-08 01:35:53 -04:00
Ed_
e3ff1ce70f Finally fixed memory allocations for slabs/pools/virtual arenas 2024-03-20 22:34:18 -04:00
Ed_
714d60ee34 Trying to figure out this bug with pools... 2024-03-20 13:34:47 -04:00
Ed_
fb1a6063a7 fixed hot reload
there is still memory issues T-T
2024-03-20 01:23:50 -04:00