Extract edit menu and Windows/bootstrap preview seams
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
#include "pch.h"
|
||||
#include "platform_windows/windows_bootstrap_helpers.h"
|
||||
#include "platform_windows/windows_platform_services.h"
|
||||
|
||||
#include "log.h"
|
||||
@@ -15,19 +16,15 @@ void destroy_window();
|
||||
void async_lock();
|
||||
void async_unlock();
|
||||
void win32_async_swap();
|
||||
void win32_renderdoc_frame_start();
|
||||
void win32_renderdoc_frame_end();
|
||||
void win32_update_fps(int frames);
|
||||
void win32_update_stylus(float dt);
|
||||
void win32_save_window_state();
|
||||
bool win32_vr_start();
|
||||
void win32_vr_stop();
|
||||
std::string GetLastErrorAsString();
|
||||
HWND pp_windows_main_window_handle();
|
||||
void pp_windows_enqueue_main_task(std::packaged_task<void()> task);
|
||||
|
||||
namespace pp::platform::windows {
|
||||
|
||||
namespace {
|
||||
|
||||
struct RetainedWin32AsyncRenderContextState final {
|
||||
@@ -43,8 +40,7 @@ struct RetainedWin32AsyncRenderContextState final {
|
||||
static RetainedWin32AsyncRenderContextState state;
|
||||
return state;
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace
|
||||
|
||||
void set_async_render_context(HDC hdc, HGLRC hrc)
|
||||
{
|
||||
@@ -63,7 +59,7 @@ void lock_async_render_context()
|
||||
state.gl_mutex.lock();
|
||||
const bool ret = wglMakeCurrent(state.hdc, state.hrc);
|
||||
if (!ret)
|
||||
LOG("FAILED wglMakeCurrent: %s", GetLastErrorAsString().c_str());
|
||||
LOG("FAILED wglMakeCurrent: %s", pp::platform::windows::GetLastErrorAsString().c_str());
|
||||
state.gl_thread = std::this_thread::get_id();
|
||||
}
|
||||
state.gl_count++;
|
||||
@@ -78,7 +74,7 @@ bool try_lock_async_render_context()
|
||||
return false;
|
||||
const bool ret = wglMakeCurrent(state.hdc, state.hrc);
|
||||
if (!ret)
|
||||
LOG("FAILED wglMakeCurrent: %s", GetLastErrorAsString().c_str());
|
||||
LOG("FAILED wglMakeCurrent: %s", pp::platform::windows::GetLastErrorAsString().c_str());
|
||||
state.gl_thread = std::this_thread::get_id();
|
||||
}
|
||||
state.gl_count++;
|
||||
@@ -100,8 +96,7 @@ void swap_async_render_context()
|
||||
{
|
||||
SwapBuffers(retained_win32_async_render_context_state().hdc);
|
||||
}
|
||||
|
||||
}
|
||||
} // namespace pp::platform::windows
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -438,12 +433,12 @@ public:
|
||||
|
||||
void begin_render_capture_frame() override
|
||||
{
|
||||
win32_renderdoc_frame_start();
|
||||
pp::platform::windows::win32_renderdoc_frame_start();
|
||||
}
|
||||
|
||||
void end_render_capture_frame() override
|
||||
{
|
||||
win32_renderdoc_frame_end();
|
||||
pp::platform::windows::win32_renderdoc_frame_end();
|
||||
}
|
||||
|
||||
[[nodiscard]] bool deletes_recorded_files_on_clear() override
|
||||
|
||||
Reference in New Issue
Block a user