mirror of https://github.com/OpenRCT2/OpenRCT2.git
add software / hardware rendering switch
This commit is contained in:
parent
aafaf0e883
commit
8920c73ea4
|
@ -19,6 +19,7 @@
|
|||
|
||||
extern "C"
|
||||
{
|
||||
#include "../config.h"
|
||||
#include "../platform/platform.h"
|
||||
}
|
||||
|
||||
|
@ -29,8 +30,14 @@ extern "C"
|
|||
void drawing_engine_init()
|
||||
{
|
||||
assert(_drawingEngine == nullptr);
|
||||
// _drawingEngine = DrawingEngineFactory::CreateSoftware();
|
||||
_drawingEngine = DrawingEngineFactory::CreateOpenGL();
|
||||
if (gConfigGeneral.hardware_display)
|
||||
{
|
||||
_drawingEngine = DrawingEngineFactory::CreateOpenGL();
|
||||
}
|
||||
else
|
||||
{
|
||||
_drawingEngine = DrawingEngineFactory::CreateSoftware();
|
||||
}
|
||||
_drawingEngine->Initialise(gWindow);
|
||||
}
|
||||
|
||||
|
|
|
@ -313,7 +313,7 @@ void platform_update_palette(const uint8* colours, int start_index, int num_colo
|
|||
}
|
||||
}
|
||||
|
||||
if (!gOpenRCT2Headless && !gHardwareDisplay) {
|
||||
if (!gOpenRCT2Headless) {
|
||||
drawing_engine_set_palette(gPalette);
|
||||
}
|
||||
}
|
||||
|
@ -802,6 +802,11 @@ void platform_refresh_video()
|
|||
|
||||
log_verbose("HardwareDisplay: %s", gHardwareDisplay ? "true" : "false");
|
||||
|
||||
drawing_engine_dispose();
|
||||
drawing_engine_init();
|
||||
drawing_engine_resize(width, height);
|
||||
drawing_engine_set_palette(gPalette);
|
||||
gfx_invalidate_screen();
|
||||
}
|
||||
|
||||
void platform_hide_cursor()
|
||||
|
|
Loading…
Reference in New Issue