MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / initialize

Method initialize

src/OpenLoco/src/Graphics/SoftwareDrawingEngine.cpp:52–70  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

50 }
51
52 void SoftwareDrawingEngine::initialize(SDL_Window* window)
53 {
54 _renderer = SDL_CreateRenderer(window, nullptr);
55 if (_renderer == nullptr)
56 {
57 // Try to fallback to software renderer.
58 Logging::warn("Hardware acceleration not available, falling back to software renderer.");
59
60 _renderer = SDL_CreateRenderer(window, "software");
61 if (_renderer == nullptr)
62 {
63 Logging::error("Unable to create software renderer: {}", SDL_GetError());
64 std::abort();
65 }
66 }
67
68 _window = window;
69 createPalette();
70 }
71
72 void SoftwareDrawingEngine::resize(const int32_t width, const int32_t height)
73 {

Callers 1

createWindowFunction · 0.80

Calls 2

warnFunction · 0.85
errorFunction · 0.85

Tested by

no test coverage detected