瀏覽代碼

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 7 年之前
父節點
當前提交
468309d06c
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: C3EAC3DE9321D59B
共有 1 個檔案被更改,包括 4 行新增3 行删除
  1. +4
    -3
      src/core.c

+ 4
- 3
src/core.c 查看文件

@ -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

Loading…
取消
儲存