Ver a proveniência

Early-exit InitWindow if InitGraphicsDevice fails

Otherwise we may run into LoadDefaultFont and crash in rlLoadTexture
Also moves InitTimer() before InitGraphicsDevice(), to allow it to be
tested even if InitWindow ultimately fails.
pull/463/head
Ahmad Fatoum há 7 anos
ascendente
cometimento
468309d06c
Não foi encontrada uma chave conhecida para esta assinatura, na base de dados ID da chave GPG: C3EAC3DE9321D59B
1 ficheiros alterados com 4 adições e 3 eliminações
  1. +4
    -3
      src/core.c

+ 4
- 3
src/core.c Ver ficheiro

@ -441,12 +441,13 @@ void InitWindow(int width, int height, void *data)
uwpWindow = (EGLNativeWindowType)data;
#endif
// Init hi-res timer
InitTimer();
// Init graphics device (display device and OpenGL context)
// NOTE: returns true if window and graphic device has been initialized successfully
windowReady = InitGraphicsDevice(width, height);
// Init hi-res timer
InitTimer();
if (!windowReady) return;
#if defined(SUPPORT_DEFAULT_FONT)
// Load default font

Carregando…
Cancelar
Guardar