orca/todo.txt

284 lines
10 KiB
Plaintext

Overview
--------
[ ] Pan/Zoom on text example
[ ] Clean+Fixes of canvas code and examples
[ ] Make backend selection easier
[ ] Investigate and fix artifact when seam is aligned to tile boundary?
[ ] Image API and backend
[ ] Build image atlas on top
[ ] Baked fonts?
[ ] Allow different versions of GL to co-exist
[ ] Backport canvas to GLES
[ ] Delegated drawing API+Impl
Clean+Fixes
-----------
[ ] Clean canvas code
[ ] make zIndex implicit when calling push_vertex
[ ] rename zIndex with "shapeIndex" everywhere
[ ] remove color args in functions that don't need it anymore
[ ] Clean shaders (folder/filenames, version string, debug flags, ...)
[ ] Fix resource loading path in examples (to load font relative to executable)
[ ] GL loader: allow using different GL versions (eg using a desktop GL surface and a GLES surface in the same app).
[ ] Clean up surface backend and canvas backend compile-time and run-time selections
[!] Investigate artifact when shifting positions of vertices by (0.5, 0.5) before multiplying
by subpixel precision and truncating... -> ie sampling at the middle of pixels vs at integer coordinates...
[ ] What alignment gives crisp-ier lines?
Canvas renderer
---------------
[.] Perf
[x] Split vertex data into per-vertex and per-shape data. Keep only pos, cubics, and shapeID in vertex data
[?] use half-floats or short fixed-point for pos and uv, packing them in two ints
[?] pre-compute triangle edges/bounding boxes?
[x] Add surface scaling for high dpi surfaces and check that our fonts are rendered smoothly
[x] Allow setting swap interval
[!] Allow swap interval of 0 on macos
[x] Use clip rects in tiling/drawing pass
[/] backport to GLES?
[/] Handle changing monitors/dpi
[ ] Ghostscript tiger stress test? -> need an svg loader, and a way to flush external command list
-----------
[.] Check changes in macos version
[x] Restructure macos version to use mp_app_internal.h/mp_app.c
[x] test new run loop structure on macos
[x] Fix resize crash when there's no surface
[>] separate data for key and mouse event?
[>] Simplify event structs
[ ] use isARepeat in macos keyDown event and simplify update key state
[x] use surfaces to define restricted drawing locations
[x] Implement with NSView subviews on osx
[/] Maybe switch to just using CALayers?
[ ] Cleanup graphics backend compile-time/runtime selection
[ ] Cleanup graphics resource handles
[.] GLES 3.0 surface on OSX
[x] GLES 3.1 surface on Win32
[.] GLES vector graphics on win32
[x] Fix triangle rasterization precision issues
-> we do not want to snap vertex coordinates to integers though, but use fixed point with 4 or 8 bits of subpixel precision
-> convert verts pos to fixed point
-> do orient2d in fixed point
[!] Check precision/possible overflow when using barycentric coords
[x] Set backround clear color
[x] Multi-sampling
[!] Avoid first useless (degenerate) triangle on every path
[>] rethink image rendering API to avoid forcing atlas into the renderer (which limits image size and usage patterns)
[x] Break triangle stream into batches to allow using different textures
[>] Design and implement basic image API
[ ] Design image atlas api on top of it
[ ] gles image atlas logic
[ ] textured rendering in shader
[ ] port back the image stuff to mac
[ ] use bindless textures on mac?
[ ] Image rendering test app
[ ] Text rendering test app
[?] Little test drawing app?
[.] Assess perf
[x] Tiling
[>] Reduce size of data sent to GPU
[ ] experiment with persistently mapped buffer?
[?] Precomputing triangle edges/biases?
[ ] Implement surfaces with child windows on win32
[/] Maybe implement compositing directly in d3d and opengl compat extension...
[ ] Cleanup routines
Windows port
------------
[.] Finish events handling
[x] window
[x] mouse move/buttons/enter/leave
[x] mouse wheel
[.] keys
[!] set key label
[x] text input
[/] pathdrop
[x] Unify app struct and window structs for different platforms?
> define common app and window struct in mp_app_internal.h
> this file conditionally includes platform specific headers, win32_app.h, osx_app.h, etc...
> these define a macro to fill the common app and window structures with platform specific stuff.
> Common app/window proc are defined in mp_app.c
> Platform specific stuff is defined in platform specific files win32_app.c, osx_app.m, etc...
(mp_app.c can 'see' platform specific stuff, so ObjectiveC defs pose a problem, but we can define id as void*
when not in ObjC...)
[.] Implement input polling
[ ] Simplify input polling API names
[/] Try to simplify input state and polling once we have UI usage code
[ ] Finish win32 window create flags and properties query/setting
[ ] Implement clipboard
[ ] Implement file dialogs
[ ] Impement resource path... -> maybe in abstracted file handling
[ ] Clean backend selection (compile time and runtime)
[ ] Finish OpenGL loader
[ ] Test compute shaders
[ ] Initial version of vector graphics backend
[ ] Check integration of UI.
[ ] Remove unused APIs
Misc
----
[ ] Clean-up file structure
[ ] Move stb libs to ext/
[ ] Renaming/clean-up pass
[ ] Separate Internal/API functions in mp_app.c
[ ] Remove MP_EVENT_KEYBOARD_MODS
[ ] Rename MP_EVENT_HIDE/SHOW to MINMIZE/UNMINIMIZE
[ ] Remove frame
[ ] Remove sequence from char event?
[ ] Replace frame_event with mp_rect
[ ] Document/unify quit/request_quit etc
[ ] Document/unify close/request_close etc
[ ] Cleanup window management
[ ] Remove unused run loop constructs
[ ]
Shortlist
---------
[x] let pass flat args in ui_size_push() and ui_box_set_size()
[x] separate style stacks
[x] animation time stack
[>] margins? as part of size, or different styling stack?
[ ] Let build code set target style directly, and animate from current to target
[ ] filter styles stack by tag
[ ] image backgrounds/gradients?
[ ] animating open/close widgets?
[.] Text box widget
[ ] Draw selection
[ ] Set cursor on click
[ ] Scroll to cursor
Canvas Drawing
--------------
[.] Correctly handle resizing / viewport
[x] associate surfaces with mp_windows
[x] window resize resizes surface. Surface always renders to whole mp_window
[x] Add ability to create sub-views, and create surfaces for these
- window comes with a main view, so we can get a surface for the whole window
[>] Clean native mp_window_data struct (don't need to cache a lot of stuff here)
[.] Add images bliting
[x] Clean, rename uv vs texUV stuff
[>] Destroy stuff
[>] More unified handle system
[.] Rounded images (sortof)
[ ] path clipped images
[ ] Add color gradients?
[ ] Make canvas implicit?
[/] Handle based error signaling
[/] Allow polling events in main thread, and updating/rendering in background thread.
[x] font metrics shouldn't depend on surface, & font
shouldn't really depend on canvas either???
> meaning we should be able to pass fonts without canvas in ui
> and only pass canvas when drawing at the end...
UI
--
[x] Make gui context implicit?
[x] Uniform ui_box struct + cache widgets
[x] Prune unused boxes
[.] Layout boxes
[x] basic two pass layout
[x] Layout from start or end
[>] Add overflow flags to layout, & solve conflicts
[x] Temporarily push transform and text flip when rendering UI, so that the coord system is y down, origin at top left
[x] Canvas render the same size on a high-dpi surface
> it works with abstract 'pixel' units, which are transformed to pixels in the shader, according to backing store scaling
[.] Style struct and style stack
[ ] Maybe use individual stack for different style attributes
[x] Pass initial style in ui_begin_frame()
[.] Draw boxes
[x] use flags to enable/disable drawing each feature
[ ] active/hovered transitions
[x] Change input state handling a move it to app layer
[x] Compute signals for ui_box
[x] Use ui_size_push() and pass axis instead of ui_width/height_push()
[>] Use value is ui_size as margin when kind == text or == children?
[ ] Allow animating sizes according to hot/active?
[ ] Basic helpers
[.] button
[.] slider (or rather, scroll bar)
[.] simple spacers
[ ] have a flag for non-cached stuff
[.] scrolling panel
[ ] Allow/disallow scrolling in x/y
[ ] Scroll with mousewheel
[/] add margins to scrollbars (disallow scrollbars crossing)
[?] Maybe let builder code handle "active"/"hot" state, since it
depends on the widgets
[ ] On the other hand, this state must be set before layouting, in
particular font/fontSize -> maybe do a pass for static layout,
instead of doing it in box creation...
[ ] this way we can compute styling after user has set active/hot, but before layout
> Maybe just let user set style selector, and provide persistent state bits that can
> be used in any way? (to replace eg active/hot?) or perhaps not needed if we have just
> 'dragging' state
[x] Mask mouse outside of parent rects -> maintain clip stack and clip mouse against it
[x] Mask mouse below panels/other widgets
[x] popups and tooltips
[x] allow pushing/popping boxes irrespective of parent/child relation
[x] ui_begin_frame() prepares two containers, user ui goes in the first one
[x] tooltips and menus go to the second one
[x] Add menus
[ ] line editing widget
Misc
----
[x] Split metal surface and metal painter (but put them in the same compilation unit?)
[x] Have only one rect struct
[x] Shorten mp_string to str8
[ ] Better/Simpler time API
[/] Frame throttling
[x] For now, we always wait on vblank during mg_surface_present(), regardless of target fps
[ ] Then actually get the correct display interval from the surface's current monitor
[ ] Allow waiting for more display interval than one? (ie allow throttling at 30fps for a 60fps display)
[/] split osx_app and move all platform independant stuff outside
[ ] Sort out mg_matrix_push/pop() -> transform vs. set...