diff --git a/Core/System.cpp b/Core/System.cpp index 8fbe2f9652..b752b64fc8 100644 --- a/Core/System.cpp +++ b/Core/System.cpp @@ -271,7 +271,11 @@ bool PSP_Init(const CoreParameter &coreParam, std::string *error_string) { bool success = coreParameter.fileToStart != ""; *error_string = coreParameter.errorString; if (success) { - GPU_Init(); + success = GPU_Init(); + if (!success) { + PSP_Shutdown(); + *error_string = "Unable to initialize rendering engine."; + } } return success; } diff --git a/GPU/GPUState.cpp b/GPU/GPUState.cpp index 063965d187..525d100631 100644 --- a/GPU/GPUState.cpp +++ b/GPU/GPUState.cpp @@ -29,7 +29,7 @@ GPUStateCache gstate_c; GPUInterface *gpu; GPUStatistics gpuStats; -void GPU_Init() { +bool GPU_Init() { switch (PSP_CoreParameter().gpuCore) { case GPU_NULL: gpu = new NullGPU(); @@ -37,12 +37,17 @@ void GPU_Init() { case GPU_GLES: gpu = new GLES_GPU(); break; -#ifndef __SYMBIAN32__ case GPU_SOFTWARE: +#ifndef __SYMBIAN32__ gpu = new SoftGPU(); - break; #endif + break; + case GPU_DIRECTX9: + // TODO + break; } + + return gpu != NULL; } void GPU_Shutdown() { diff --git a/GPU/GPUState.h b/GPU/GPUState.h index 5873f672e3..9582f49c69 100644 --- a/GPU/GPUState.h +++ b/GPU/GPUState.h @@ -490,7 +490,7 @@ struct GPUStatistics { int numFBOs; }; -void GPU_Init(); +bool GPU_Init(); void GPU_Shutdown(); void InitGfxState();