18
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-14 11:13:34 +01:00
Files
maszyna/rendering/nullrenderer.cpp
jerrrrycho 441caeed64 refactor(simulation): tidy the test mode code
The test manager is reached through simulation::test() instead of a global,
the result cell is owned by a unique_ptr until the memory table takes it, the
cell value is compared with a margin, strings are built with std::format and
the --test settings moved to apply_test_mode_settings(). The driver's signal
check is folded into UpdateSpeedPosition(), which updates a speed table entry
and reports a signal at stop the head of the train just passed. The test.*
keys are listed with the other settings at the start of the log.
2026-11-07 17:12:11 +01:00

30 lines
797 B
C++

#include "stdafx.h"
#include "rendering/nullrenderer.h"
#include "application/application.h"
void null_imgui_renderer::BeginFrame()
{
auto &io { ImGui::GetIO() };
if( false == io.Fonts->IsBuilt() ) {
unsigned char *pixels { nullptr };
int width { 0 };
int height { 0 };
io.Fonts->GetTexDataAsAlpha8( &pixels, &width, &height );
}
}
bool null_renderer::Render()
{
// the ui frame begun by the application has to be ended, or imgui won't start the next one
Application.render_ui();
return true;
}
std::unique_ptr<gfx_renderer> null_renderer::create_func()
{
return std::make_unique<null_renderer>();
}
bool null_renderer::renderer_register = gfx_renderer_factory::get_instance()->register_backend("null", null_renderer::create_func);