Commit Graph

23 Commits

Author SHA1 Message Date
Martin Fouilleul 116e614ab6 Keep log format as "function() in file:line: msg", but pass the arguments in consistent order between the host and guest app. 2023-09-18 10:19:13 +00:00
Ilia Demianenko a5567da82c Clipboard handling 2023-09-13 16:59:26 +02:00
Martin Fouilleul d53c688810 Keyboard layout support:
- Convey both fixed scancodes and keyboard-layout dependent keycodes in key events.
- Update scancode to keycode mapping when keyboard layout changes
- Allow querying key input state using either keycodes or scancodes
2023-09-13 16:22:33 +02:00
Martin Fouilleul 313f2e0ad4 Fix quit by sending an event to wakeup the main loop when calling oc_request_quit() 2023-09-11 18:36:40 +02:00
Martin Fouilleul 06a7642055 Licensing and copyright information 2023-09-11 11:09:47 +02:00
Martin Fouilleul e6a3ac7694 oc_render uses currently selected surface 2023-09-10 15:21:11 +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
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 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 4b1ab4db97 expose oc_surface_contents_scaling() to get dpi scaling from a surface 2023-08-28 12:10:29 +02: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
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
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
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
Martin Fouilleul 94b9cb2bbf Auto-formatting with clang-format 2023-08-19 15:52:11 +02:00
Martin Fouilleul 75621d85a5 Big renaming and consistency pass, including:
- "Namespacing" the Orca APIs by adding the oc_ prefix everywhere
- Naming consistency tweaks, eg create_from_memory vs. create_from_data
- Adhering to a more consistent convention when pairing functions defining entities lifetime, eg. create/destroy, push/clear, alloc/recycle, init/cleanup
- Preferring oc_str8 to const char*, except when we expect lots of C string literals (e.g. when tagging UI widgets) or when it would be annoying to systematically wrap data we want to read/write into a string
- Reorganize macros for asserts/logging, and properly exposing them to the apps with non conflicting names
- Generally rearrange some bits and pruning unused stuff to make things more navigable
2023-08-18 16:30:55 +02:00
Martin Fouilleul cf88ba6290 This commit restructures the codebase to melt the milepost platform layer into the main orca codebase.
Here's a list of commits squashed in this update:

- move angle files to ext/ and pull includes/libs from there when needed
- remove milepost/ext/angle_headers
- Collapsed milepost/ext into ext
- Collapse milepost/scripts into scripts/
- collapse milepost/resources into resources/. WARN: this temporarily breaks milepost's native examples
- collapse milepost/test into test/
- renamed test/ to tests/
- build milepost directly into build/bin
- remove unused GLES and KHR folders from sdk/
- reorganizing milepost directory tree into app, graphics, platfrom, ui, util
- collapse milepost/src to src/
- Move all native examples to sketches/ and remove milepost repo
- Moving sketches resources into their own shared folder separate from the runtime's resource folder
- Moving all binding code to src/wasmbind
- Moving all binding code to src/wasmbind
- pong: fix typo in error log
- fixing log parameter order
- add error logs to mg_image_create_*
- Fix build scripts on windows
- fixed include mistake after rebase
- collapsing milepost.{h|c|m} to orca.{h|c|m} and moving from sdk/ to src/
- rename orca_app.h/main.c to runtime.h/c
- collapsed sdk/ to src/
- put old sdk files into their respective dirs
- renamed canvas_api.json to surface_api.json
- moved all stb headers in ext/stb/
- remove unused OpenSansLatinSubset.ttf font
- moving cstdlib to src/wasmlibc and removing some duplicates with src/platform
- move libc stdarg and string functions from platform/ to wasmlibc/
- rename wasmlibc to libc-shim to reflect non-completeness
- Expose abort/assert variadic functions and macros to orca apps, and forward libc-shim abort/assert to these
- move Orca API runtime implementations to runtime_xxx
- fix missing math constants when including math.h with msvc in graphics_common.c
- Change name of runtime to orca_runtime. When bundling on Windows, change name of runtime executable to the name of the app.
2023-08-13 15:28:57 +02:00