diff options
| author | Andre Weissflog <floooh@gmail.com> | 2021-04-21 19:15:09 +0200 |
|---|---|---|
| committer | Andre Weissflog <floooh@gmail.com> | 2021-04-21 19:15:09 +0200 |
| commit | 5a34f90d1ff2d694244c03aa2a669dea2b48b82a (patch) | |
| tree | f53251389a5936bc24127e91800ffcc994fc751b | |
| parent | 8f86a7225a4dd07feda2db0eddbcbddf849092dd (diff) | |
| parent | c7506acdf621978fcc9f122863144452df4bece2 (diff) | |
merge latest changes from master
| -rw-r--r-- | sokol_app.h | 18 | ||||
| -rw-r--r-- | sokol_time.h | 1 |
2 files changed, 19 insertions, 0 deletions
diff --git a/sokol_app.h b/sokol_app.h index c8b233aa..840eba23 100644 --- a/sokol_app.h +++ b/sokol_app.h @@ -1523,6 +1523,8 @@ SOKOL_APP_API_DECL const void* sapp_ios_get_window(void); SOKOL_APP_API_DECL const void* sapp_d3d11_get_device(void); /* D3D11: get pointer to ID3D11DeviceContext object */ SOKOL_APP_API_DECL const void* sapp_d3d11_get_device_context(void); +/* D3D11: get pointer to IDXGISwapChain object */ +SOKOL_APP_API_DECL const void* sapp_d3d11_get_swap_chain(void); /* D3D11: get pointer to ID3D11RenderTargetView object */ SOKOL_APP_API_DECL const void* sapp_d3d11_get_render_target_view(void); /* D3D11: get pointer to ID3D11DepthStencilView */ @@ -3662,6 +3664,13 @@ _SOKOL_PRIVATE void _sapp_macos_frame(_sapp_window_t* win) { _SOKOL_UNUSED(aNotification); _sapp.main_window_id = _sapp_create_window(&_sapp.desc.window); + + // FIXME: maybe the activation stuff here needs to be moved before + // the makeKeyAndOrderFront call, see here: + // https://github.com/floooh/sokol/pull/515#issuecomment-824221751 + NSApp.activationPolicy = NSApplicationActivationPolicyRegular; + [NSApp activateIgnoringOtherApps:YES]; + [NSEvent setMouseCoalescingEnabled:NO]; _sapp_window_t* win = _sapp_push_window(_sapp.main_window_id); _sapp_macos_update_dimensions(win); @@ -11482,6 +11491,15 @@ SOKOL_API_IMPL const void* sapp_d3d11_get_device_context(void) { #endif } +SOKOL_API_IMPL const void* sapp_d3d11_get_swap_chain(void) { + SOKOL_ASSERT(_sapp.valid); +#if defined(SOKOL_D3D11) + return _sapp.d3d11.swap_chain; +#else + return 0; +#endif +} + SOKOL_API_IMPL const void* sapp_d3d11_get_render_target_view(void) { SOKOL_ASSERT(_sapp.valid); #if defined(SOKOL_D3D11) diff --git a/sokol_time.h b/sokol_time.h index 8821da70..3bf1167e 100644 --- a/sokol_time.h +++ b/sokol_time.h @@ -284,6 +284,7 @@ static const uint64_t _stm_refresh_rates[][2] = { { 13333333, 250000 }, // 75 Hz: 13.3333 +- 0.25ms { 11764706, 250000 }, // 85 Hz: 11.7647 +- 0.25 { 11111111, 250000 }, // 90 Hz: 11.1111 +- 0.25ms + { 10000000, 500000 }, // 100 Hz: 10.0000 +- 0.5ms { 8333333, 500000 }, // 120 Hz: 8.3333 +- 0.5ms { 6944445, 500000 }, // 144 Hz: 6.9445 +- 0.5ms { 4166667, 1000000 }, // 240 Hz: 4.1666 +- 1ms |