Route render capture hooks through platform services
This commit is contained in:
13
src/app.cpp
13
src/app.cpp
@@ -16,10 +16,7 @@
|
||||
#endif
|
||||
#include "settings.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
void win32_renderdoc_frame_start();
|
||||
void win32_renderdoc_frame_end();
|
||||
#elif __LINUX__
|
||||
#ifdef __LINUX__
|
||||
std::string linux_home_path();
|
||||
int mkpath(const std::string& dir, mode_t mode = DEFFILEMODE);
|
||||
#elif __WEB__
|
||||
@@ -818,16 +815,12 @@ std::string App::res_to_string(int res)
|
||||
|
||||
void App::renderdoc_frame_start()
|
||||
{
|
||||
#if __WIN__
|
||||
win32_renderdoc_frame_start();
|
||||
#endif
|
||||
begin_render_capture_frame();
|
||||
}
|
||||
|
||||
void App::renderdoc_frame_end()
|
||||
{
|
||||
#if __WIN__
|
||||
win32_renderdoc_frame_end();
|
||||
#endif
|
||||
end_render_capture_frame();
|
||||
}
|
||||
|
||||
void App::rec_clear()
|
||||
|
||||
@@ -195,6 +195,8 @@ public:
|
||||
void acquire_render_context();
|
||||
void release_render_context();
|
||||
void present_render_context();
|
||||
void begin_render_capture_frame();
|
||||
void end_render_capture_frame();
|
||||
void update_platform_frame(float delta_time_seconds);
|
||||
void report_rendered_frames(int frames);
|
||||
void save_prepared_file(
|
||||
|
||||
@@ -244,6 +244,16 @@ void App::present_render_context()
|
||||
active_platform_services().present_render_context();
|
||||
}
|
||||
|
||||
void App::begin_render_capture_frame()
|
||||
{
|
||||
active_platform_services().begin_render_capture_frame();
|
||||
}
|
||||
|
||||
void App::end_render_capture_frame()
|
||||
{
|
||||
active_platform_services().end_render_capture_frame();
|
||||
}
|
||||
|
||||
void App::update_platform_frame(float delta_time_seconds)
|
||||
{
|
||||
active_platform_services().update_platform_frame(delta_time_seconds);
|
||||
|
||||
@@ -23,6 +23,8 @@ public:
|
||||
virtual void acquire_render_context() = 0;
|
||||
virtual void release_render_context() = 0;
|
||||
virtual void present_render_context() = 0;
|
||||
virtual void begin_render_capture_frame() = 0;
|
||||
virtual void end_render_capture_frame() = 0;
|
||||
virtual void update_platform_frame(float delta_time_seconds) = 0;
|
||||
virtual void report_rendered_frames(int frames) = 0;
|
||||
virtual void display_file(std::string_view path) = 0;
|
||||
|
||||
@@ -144,6 +144,14 @@ public:
|
||||
#endif
|
||||
}
|
||||
|
||||
void begin_render_capture_frame() override
|
||||
{
|
||||
}
|
||||
|
||||
void end_render_capture_frame() override
|
||||
{
|
||||
}
|
||||
|
||||
void update_platform_frame(float delta_time_seconds) override
|
||||
{
|
||||
(void)delta_time_seconds;
|
||||
|
||||
@@ -13,6 +13,8 @@ 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);
|
||||
|
||||
@@ -201,6 +203,16 @@ public:
|
||||
win32_async_swap();
|
||||
}
|
||||
|
||||
void begin_render_capture_frame() override
|
||||
{
|
||||
win32_renderdoc_frame_start();
|
||||
}
|
||||
|
||||
void end_render_capture_frame() override
|
||||
{
|
||||
win32_renderdoc_frame_end();
|
||||
}
|
||||
|
||||
void update_platform_frame(float delta_time_seconds) override
|
||||
{
|
||||
win32_update_stylus(delta_time_seconds);
|
||||
|
||||
Reference in New Issue
Block a user