Martin Fouilleul
5a7182a3b9
make vsync differences between win32 and macos explicit in runtime.c
2023-09-09 14:34:20 +02:00
Reuben Dunnington
6ae129022e
rework vsync to be manual wait for win32
2023-09-08 21:35:13 -07:00
Reuben Dunnington
d9703519b9
osx vsync notification
2023-09-08 20:58:14 -07:00
Reuben Dunnington
aa1c5ef915
cleanup dead code
2023-09-08 20:58:14 -07:00
Reuben Dunnington
be5b6aea30
vblank notification: win32
2023-09-08 20:58:11 -07:00
Ilia Demianenko
3bcbc76662
Make tooltip disappear on mouse leave
2023-09-08 14:35:42 +02:00
Ilia Demianenko
b4797dcd2d
Light UI theme
2023-09-08 12:22:03 +00:00
Martin Fouilleul
907f33bc27
[osx] quickfix for frame pacing on osx, keep swap interval to 1 for all surfaces
2023-09-08 10:32:59 +02:00
martinfouilleul
3effde949e
Fix file date on windows
2023-09-08 10:18:22 +02:00
Martin Fouilleul
8f413fdb46
fix auto-scrolling in debug UI (due to change in how oc_ui_panel() is structured)
2023-09-08 10:11:51 +02:00
Martin Fouilleul
a275b3da28
adding file timestamps to file_status
2023-09-07 10:09:26 +02:00
Reuben Dunnington
15a8e2ae22
wasm bindings: enforce pointer length
...
* bindgen.py: print an error when a pointer argument doesn't have an annotated length
* ensure all bindings with pointers have length annotations
* add a couple helper functions for dealing with length annotations
2023-09-07 07:51:23 +00:00
Ilia Demianenko
15bc29d703
Merge branch 'main' of git.handmade.network:hmn/orca into ui-redesign
2023-09-06 22:31:03 -07:00
Ilia Demianenko
aff03630da
Make UI look nicer
...
Design system by semi.design: https://semi.design/en-US/start/overview
SVG icon workflow:
- Find the SVG with devtools
- Copy curve path to https://yqnn.github.io/svg-path-editor/
- Scale X and Y by 1/size (usually 1/24)
- In `ui.c`, do offset and scale with a matrix transform, then the draw commands can use the exact numbers from the normalized SVG
2023-09-06 22:24:00 -07:00
Martin Fouilleul
425d9b3448
- Added basic cheatsheets
...
- Minor cleanups:
- Hiding some native-only path APIs
- Re-formatting ui.h
2023-09-06 08:58:43 +02:00
Martin Fouilleul
bd35b75f4b
Minor API cleanup:
...
- Removing unused remote/host surfaces for now
- Complete canvas attributes getters
- Separate surface creation APIs accessible by host and guest
- added oc_get_matrix(), removed oc_viewport()
- oc_get_clip -> oc_clip_top, oc_get_matrix -> oc_matrix_top
2023-09-06 08:58:04 +02:00
Martin Fouilleul
fbb03d27a3
Helpers for manipulating orca structs living in wasm memory:
...
- convert between wasm memory and native pointers, asserting on out-of-bounds
- oc_wasm_list helpers
- oc_wasm_str8 helpers
- pushing things to arenas in wasm memory
2023-09-02 18:07:57 +02:00
Martin Fouilleul
0205d90941
- Added oc_file_open_with_request() to request new file capability for a given path. This presents user with a message box allowing them to accept or deny the request.
...
- Added oc_file_open_with_dialog() to ask user to grant new file capabilities through an open/save dialog.
2023-09-02 11:00:28 +02:00
Martin Fouilleul
0db1589dc6
[canvas] remove degenerate point lines when encoding strokes
2023-09-01 19:40:37 +02:00
martinfouilleul
19ce7447aa
use app->quit on main thread instead of oc_should_quit(), to ensure that runloop_thread always exits its event loop before main thread
2023-08-30 12:06:32 +02:00
Martin Fouilleul
1907663cdc
Skip drawing ui box when it's rect + boders are fully outside current clip
2023-08-29 18:43:25 +02:00
martinfouilleul
46ef9ee7e8
don't hide debug overlay, paint it transparent instead, brought to you by Windows stuttering and crashing on close if you call SwapBuffer on a hidden window :*)
2023-08-29 16:14:20 +00:00
Martin Fouilleul
f268f031af
Set user-created surfaces to non-blocking and use the debug overlay surface to block on vsync.
2023-08-29 16:14:20 +00:00
Martin Fouilleul
07414af087
[mtl canvas] Fix nTilesX/nTilesY computation in oc_mtl_canvas_render (don't multiply twice by scale)
2023-08-29 18:13:01 +02:00
Martin Fouilleul
9164e66cc6
[mtl canvas] fixed bug were order of mtl_segment_setup arguments tileOpMax and segmentMax were interverted, which would cull tile ops based on max number of segments, causing weird artifacts for some lengths of the segment buffer
2023-08-29 17:36:30 +02:00
martinfouilleul
ec97c6d9ca
win32 implementation of oc_surface_bring_to_front/send_to_back
2023-08-28 17:04:55 +02:00
Martin Fouilleul
02bfe30672
Expose oc_surface_bring_to_front/send_to_back() to orca apps, and always bring debug layer to front when displaying it
2023-08-28 16:11:55 +02:00
Martin Fouilleul
b5034d3c81
[osx] implement oc_surface_bring_to_front() and oc_surface_send_to_back()
2023-08-28 15:48:24 +02:00
Reuben Dunnington
ceb4a3a95d
[osx canvas] Early out when eltCount or pathCount == 0, which avoid encoding empty passes and firing metal asserts when running in debug mode from xcode.
2023-08-28 12:16:31 +02:00
Martin Fouilleul
4b1ab4db97
expose oc_surface_contents_scaling() to get dpi scaling from a surface
2023-08-28 12:10:29 +02:00
Ilia Demianenko
3c199dce34
minor
2023-08-25 15:46:11 +02:00
Ilia Demianenko
53cf85db53
Support move/select/delete word with keyboard in textbox
2023-08-25 15:46:04 +02:00
Reuben Dunnington
1917085990
win32: initialize clock in oc_init()
2023-08-25 13:39:04 +00:00
Ilia Demianenko
396d52edcd
Clamp rounded rect radius
2023-08-25 13:33:49 +00:00
Reuben Dunnington
fad375c403
macos window title/size
...
* add macOS implmentation for oc_window_set_title()
* move implementation of oc_window_set_content_size() to a block that
is guaranteed to run on the main thread
2023-08-24 11:57:41 -07:00
Reuben Dunnington
bfd4c2a450
update oc_window_set_content_size to use oc_vec2 for consistency
2023-08-24 11:42:27 -07:00
Reuben Dunnington
d4cb93c61a
oc_runtime_window_set_title and oc_runtime_window_set_size
2023-08-24 11:42:27 -07:00
Reuben Dunnington
e4ac212408
wip window title and size API
2023-08-24 11:42:26 -07:00
Reuben Dunnington
72209200b5
format app.h
2023-08-24 11:42:26 -07:00
Reuben Dunnington
b9e843f4bb
fix some crashes in metal implementation when pathCount and etlCount are 0
2023-08-24 11:33:21 -07:00
Martin Fouilleul
42738195b5
Don't assume oc_scratch() is cleared at the frame boundary. Use oc_scratch_begin()/oc_scratch_end() instead
2023-08-23 16:24:13 +02:00
Martin Fouilleul
98f131cb30
Fix leak in metal surface: command buffer must not be committed if there is no surface to present it to, or it will result in a huge leak in metal resources. Also wrap oc_mtl_surface_acquire_command_buffer() in an @autoreleasepool to fix a smaller leak
2023-08-23 15:09:06 +02:00
Martin Fouilleul
edaffcb649
implement oc_window_is_minimized on macos
2023-08-23 12:16:01 +02:00
Reuben Dunnington
7b48c20c26
remove stray declaration
2023-08-22 21:32:13 +00:00
Reuben Dunnington
9ca7e82c82
flatten oc_request_quit() binding
2023-08-22 21:32:13 +00:00
Reuben Dunnington
0973e26150
expose oc_request_quit() to wasm runtime
2023-08-22 21:32:13 +00:00
Reuben Dunnington
9d1d8e5306
add win32 impl for oc_clock_time()
2023-08-22 13:42:01 -07:00
Ilia Demianenko
2c07c9b665
Bring back the main modifier, get rid of _impl
2023-08-22 20:15:21 +00:00
Ilia Demianenko
a6f81a1320
Use textbox shortcuts from the host platform
2023-08-22 20:15:21 +00:00
Reuben Dunnington
7755827485
ensure focus remains on main window when creating child windows
2023-08-22 20:10:57 +00:00