Commit Graph

636 Commits

Author SHA1 Message Date
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
Martin Fouilleul fe25476305 remove stale comments in samples 2023-08-30 15:35:28 +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 d86d0f8074 replace cp with copy in sketches build.bat scripts 2023-08-29 07:56:28 +00: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 416044ea76 Makes sketches compile and run with changes introduced by renaming pass.
This is a combination of 19 commits:

- fix atlas
- fix canvas
- fix image
- add OpenSansLatinSubset to resources
- fix multi_surface
- fix perf_text
- fix polygon
- fix render_thread
- fix simpleWindow
- fix smooth_resize
- fix surface_sharing
- fixed tiger
- fix triangleGL
- fix triangleGLES (note rendering doesn't work)
- fix ui
- fix all on osx
- Fix sketch triangleGLES
- Make transparent rectangle clearer in sketches polygon
- Add proper error message in sketch/triangleGL on macOS
2023-08-28 12:37:33 +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
MartinFouilleul 0727466f48 Merge pull request 'Support move/select/delete word with keyboard in textbox' (#63) from ilidemi/orca:text-box-words into main
Reviewed-on: #63
2023-08-25 13:50:14 +00: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
MartinFouilleul 5c89f1d103 Merge pull request 'window_size_title_api' (#61) from window_size_title_api into main
Reviewed-on: #61
2023-08-25 13:29:27 +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 9ed636e018
update samples for oc_window_set_content_size oc_vec2 change 2023-08-24 11:42:28 -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 81712c14c1
update samples with title/window size 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
MartinFouilleul d3e27df818 Merge pull request 'Fix leak in canvas code and samples' (#60) from fix_canvas_leak into main
Reviewed-on: #60
2023-08-23 14:33:22 +00: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 86b1121fbe allow enabling/disabling metal frame capture when bundling a macos app 2023-08-23 15:06:35 +02:00
Martin Fouilleul 232c5f4f4c Fix exec permission on samples/clock/build.sh 2023-08-23 12:21:02 +02:00
Reuben Dunnington 4bde491a36 clock sample app 2023-08-23 12:16:32 +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 f4a82cd381 pong: demo oc_request_quit() and oc_on_terminate()
* gamestate now records your score (total blocks destroyed)
* when all blocks are destroyed, quit
* print a message when the app is terminated
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
Reuben Dunnington 5a4fba96fa clang-format: use custom brace/indent style 2023-08-22 20:18:04 +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
Reuben Dunnington 7755827485 ensure focus remains on main window when creating child windows 2023-08-22 20:10:57 +00:00
Reuben Dunnington c27e1c6b62
don't attempt to draw when the window is minimized 2023-08-22 07:43:22 -07:00
Reuben Dunnington 513bdacf64
disable include sorting - we rely on include order in some places 2023-08-21 14:39:09 -07:00
Reuben Dunnington 464a25c55d
fixes for a couple compile errors 2023-08-21 11:50:42 -07:00
Martin Fouilleul 94b9cb2bbf Auto-formatting with clang-format 2023-08-19 15:52:11 +02:00