Skip to content

Commit

Permalink
ref_soft: check if renderer and texture are created correctly during …
Browse files Browse the repository at this point in the history
…context initialization
  • Loading branch information
john-tornblom committed Nov 16, 2024
1 parent ccc9027 commit 0ea0dbf
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/client/refresh/soft/sw_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1932,6 +1932,10 @@ RE_InitContext(void *win)
}
#endif
}
if(!renderer) {
Com_Printf("Can't create renderer: %s\n", SDL_GetError());
return false;
}

/* Select the color for drawing. It is set to black here. */
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 0);
Expand Down Expand Up @@ -1974,7 +1978,10 @@ RE_InitContext(void *win)
#endif
SDL_TEXTUREACCESS_STREAMING,
vid_buffer_width, vid_buffer_height);

if(!texture) {
Com_Printf("Can't create texture: %s\n", SDL_GetError());
return false;
}
R_InitGraphics(vid_buffer_width, vid_buffer_height);
SWimp_CreateRender(vid_buffer_width, vid_buffer_height);

Expand Down

0 comments on commit 0ea0dbf

Please sign in to comment.