mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-18 12:33:17 +01:00
Defer instantiation of TextureCache until OpenGL is initialized
If TextureCache is instantiated before OpenGL is initialized and something goes wrong during OpenGL initialization the destructor of TextureCache calls an OpenGL function which will cause the application to crash.
This commit is contained in:
@@ -503,7 +503,6 @@ IDrawingEngine * DrawingEngineFactory::CreateOpenGL()
|
||||
OpenGLDrawingContext::OpenGLDrawingContext(OpenGLDrawingEngine * engine)
|
||||
{
|
||||
_engine = engine;
|
||||
_textureCache = new TextureCache();
|
||||
}
|
||||
|
||||
OpenGLDrawingContext::~OpenGLDrawingContext()
|
||||
@@ -522,6 +521,7 @@ IDrawingEngine * OpenGLDrawingContext::GetEngine()
|
||||
|
||||
void OpenGLDrawingContext::Initialise()
|
||||
{
|
||||
_textureCache = new TextureCache();
|
||||
_drawImageShader = new DrawImageShader();
|
||||
_drawLineShader = new DrawLineShader();
|
||||
_fillRectShader = new FillRectShader();
|
||||
|
||||
Reference in New Issue
Block a user