Martin Fouilleul
7b2ef080e8
[util, formatting] shorten list loop names to for_list_xxx
2023-03-08 12:03:33 +01:00
Martin Fouilleul
3682605f97
[util, formatting] changed list api to snakecase for consistency with the rest of the codebase
2023-03-08 12:00:10 +01:00
Martin Fouilleul
bfc19665ce
[util]
...
- shorten str8_lit macro to STR8
- use strlen() in STR8 and remove str8_from_cstring(). Usage with string literal seem to always be optimized by compile-time constant, so there's little need for a confusing macro that only works with literals and breaks with pointers.
- replaced str8_unbox() with str8_lp/str8_ip
2023-03-08 11:40:40 +01:00
Martin Fouilleul
f07f56948d
[ui] shorten ui styling api names
2023-03-08 11:13:32 +01:00
Martin Fouilleul
8b06cb31ba
[ui, styling]
...
- Put all styling calls _before_ the styled box.
- Renamed full pattern matching API to ui_style_match_next_before/after
- Helper to style next box only (ui_style_next())
2023-03-08 11:09:28 +01:00
Martin Fouilleul
c551135933
[ui] remove the need to pass a default style to ui_frame()
2023-03-07 19:44:22 +01:00
Martin Fouilleul
2466241b1e
[ui, styling] finished first pass on core layout/styling system
2023-03-07 19:27:01 +01:00
Martin Fouilleul
8032c7340b
[ui, styling] revisiting layout/sizing
2023-03-07 19:06:04 +01:00
Martin Fouilleul
d3a8a651e5
[ui, styling] make layout and floating properties part of styling system
2023-03-07 10:33:22 +01:00
Martin Fouilleul
7b10a99a8c
[ui, styling] First draft of rule-based styling to replace old stack-based system
2023-03-06 19:33:01 +01:00
Martin Fouilleul
b52a35c753
[ui, textbox] Fixed selection background rectangle
2023-03-05 17:03:00 +01:00
Martin Fouilleul
1af132352a
[ui, textbox] Scroll text inside text box to always show edit cursor.
2023-03-05 16:35:55 +01:00
Martin Fouilleul
592f4cdecd
end of line renormalization
2023-03-05 16:05:43 +01:00
Martin Fouilleul
4359bdaa3c
[ui, textbox] position cursor at mouse position / extend selection on shift + mouse press or drag
2023-03-05 15:59:57 +01:00
Martin Fouilleul
e95efe85e8
[wip, input system] Fixed bug on macOS, where keyUp events are not received when the command modifier key is down and makes a meaningful combination with the pressed key (note this is normal macOS event handling behaviour, but we still want all events to arrive to track key states).
...
Fixed by overloading the sendEvent method of our derived NSApplication class. There we check if modifier is down and send the event.
Note glfw solves that by adding a block handler for the keyUp event with addLocalMonitorForEventsMatchingMask.
2023-03-04 19:24:30 +01:00
Martin Fouilleul
c04e8639ab
[wip, ui] re-integrating UI subsystem and completing text box
2023-03-03 20:09:44 +01:00
Martin Fouilleul
d21e737733
[wip] re-introducing UI subsystem
2023-03-03 17:13:03 +01:00
martinfouilleul
653ddec978
[win32 surface sharing] win32 surface sharing using window reparenting
2023-03-03 12:41:09 +01:00
Martin Fouilleul
731e5b1ae8
[surface] pull mp_layer into the generic mg_surface_data struct, out of each backend-specific implementation
2023-03-03 11:50:12 +01:00
martinfouilleul
ac00cc9def
[wip, win32 surface sharing] simplifyin the surface sharing API
2023-03-02 19:21:39 +01:00
martinfouilleul
ee87976429
[win32 surface sharing] hacky proof of concept
2023-03-02 18:24:15 +01:00
martinfouilleul
3ada8ece9a
[wip, win32 surface sharing] in surface sharing example, terminate child process when parent exits
2023-03-02 12:23:10 +01:00
martinfouilleul
e58ae3ef52
[surface sharing] first draft for win32 using window reparenting
2023-03-02 09:54:12 +01:00
martinfouilleul
2560ddd5b4
[win32] adding simple IPC to test delegated surface
2023-03-01 18:58:59 +01:00
martinfouilleul
1dfc5dd684
[graphics, win32] applying changes to surface backend API
2023-03-01 17:41:39 +01:00
Martin Fouilleul
43d413dbbc
[surface] graphics surface sharing API + osx implementation
2023-03-01 16:15:36 +01:00
Martin Fouilleul
28f5af32fa
[graphics] Allocate canvases and fonts from graphics subsystem's arena
2023-03-01 11:37:33 +01:00
Martin Fouilleul
6bf989564d
[graphics] use a single handle arena for all graphics subsystem handles
2023-02-28 20:33:55 +01:00
Martin Fouilleul
5a19c03ad6
[canvas] removing unused old atlasing api
2023-02-28 18:47:45 +01:00
Martin Fouilleul
3615775168
[canvas] decompose image atlas API into simple rect atlas API + image atlas helpers. This avoids creating a bunch of new types/handles, and exposes the underlying image/sourceRegion so that user code can freely use these for more complex scenarios (eg drawing only a sub-region of an atlased image, or using an atlas image for arbitrary path filling)
2023-02-28 16:54:39 +01:00
Martin Fouilleul
d4bceba7e9
[canvas] basic image atlas API
2023-02-28 13:16:36 +01:00
martinfouilleul
9cb4aedbc5
[canvas, gl] use pre-multiplied alpha in draw shader and when compositing batches
2023-02-27 19:50:18 +01:00
martinfouilleul
ac6a5db209
[canvas, gl] Checked batching/transparency
2023-02-27 19:39:26 +01:00
Martin Fouilleul
5fa07cb462
adding image with transparency (top512.png) in resources to test transparency/overlaying
2023-02-27 19:34:54 +01:00
martinfouilleul
8f834fa1a5
[wip, canvas, gl] implementing basic image API
2023-02-27 19:25:41 +01:00
Martin Fouilleul
5e5f8ac5e7
adding image test/example
2023-02-27 15:43:41 +01:00
Martin Fouilleul
30aa6a4a48
[canvas] Put primitive's transform in the attributes struct. When rendering, set current transform at the beginning of mg_next_shape(). (This avoid using an additional prevTransform matrix to correctly setup uvTransform when mg_finalize_shape() at the beginning of mg_next_shape())
2023-02-27 15:01:44 +01:00
Martin Fouilleul
d195fb1f61
[canvas, mtl backend] Compute each layer with pre-multiplied alpha, starting from transparent color. Composite them to surface with premultiplied alpha too.
2023-02-27 14:24:59 +01:00
Martin Fouilleul
9ed630fc55
[canvas]
...
- Clear final surface to clear color, and enable blending layers onto it
- Fixed Batching bug where we were writing to vertex/shape buffers while the previous batch is using them
- Fixed bug where uvTransform uses transform of next shape instead of that of shape being finalized
2023-02-27 11:56:04 +01:00
Martin Fouilleul
e66932e624
[canvas] Set command attributes to canvas->attributes by default in mg_push_command()
2023-02-25 15:35:24 +01:00
Martin Fouilleul
193afb61fd
[canvas] move canvas structs decl from graphics_internal.h to graphics.c, keep only surface/canvas backend interface stuff in graphics_internal.h
2023-02-25 15:23:15 +01:00
Martin Fouilleul
074b17b743
[canvas] Set transform matrix as part of primitive and don't replay push/pop during render
2023-02-25 14:20:07 +01:00
Martin Fouilleul
b24de5d969
[canvas] Allow setting image source region
2023-02-25 12:59:49 +01:00
Martin Fouilleul
50569a1427
Allow setting texture on arbitrary path fills
2023-02-24 23:06:39 +01:00
Martin Fouilleul
4333ed02b0
[canvas] remove image draw commands, replace with rect/rounded rects + image source
2023-02-24 22:59:33 +01:00
Martin Fouilleul
1b62ec568c
[canvas, mtl backend] Handle image rotation
2023-02-24 20:40:16 +01:00
Martin Fouilleul
bb106b717f
Build user-space bounding box of shape in mg_push_vertex() _before_ transforming vertices
2023-02-24 19:20:05 +01:00
Martin Fouilleul
11c25bf001
Make transform implicit in mg_push_vertex()
2023-02-24 19:11:03 +01:00
Martin Fouilleul
5be019d166
[canvas, metal] compute uv coords in shader using uvTransformed computed in canvas backend, using shape bounding box, image dimension, source and dest regions
2023-02-24 18:50:46 +01:00
Martin Fouilleul
fd4c4e7be3
[canvas] simple image API
2023-02-24 12:01:00 +01:00