1
0
mirror of https://github.com/pevans/erc-c.git synced 2024-12-27 01:32:17 +00:00

Revert "Separate window and renderer creation; use software rendering"

This reverts commit c178e417b7.
This commit is contained in:
Peter Evans 2018-04-05 20:57:09 -05:00
parent 206bd86196
commit f8dd49e892

View File

@ -110,23 +110,13 @@ vm_screen_add_window(vm_screen *screen, int width, int height)
// If HEADLESS is defined, we will assume we _don't_ want an actual // If HEADLESS is defined, we will assume we _don't_ want an actual
// drawing surface, but want to pretend we've added one. // drawing surface, but want to pretend we've added one.
#ifndef HEADLESS #ifndef HEADLESS
screen->window = SDL_CreateWindow("erc", SDL_CreateWindowAndRenderer(
SDL_WINDOWPOS_UNDEFINED, width, height, 0, &screen->window, &screen->render);
SDL_WINDOWPOS_UNDEFINED,
width, height, 0);
if (screen->window == NULL) { if (screen->window == NULL || screen->render == NULL) {
log_crit("Could not create window: %s", SDL_GetError()); log_crit("Could not create window: %s", SDL_GetError());
return ERR_GFXINIT; return ERR_GFXINIT;
} }
screen->render = SDL_CreateRenderer(screen->window, -1,
SDL_RENDERER_SOFTWARE);
if (screen->render == NULL) {
log_crit("Could not create renderer: %s", SDL_GetError());
return ERR_GFXINIT;
}
#endif #endif
// We plan to draw onto a surface that is xcoords x ycoords in area, // We plan to draw onto a surface that is xcoords x ycoords in area,
@ -205,7 +195,7 @@ vm_screen_active(vm_screen *scr)
void void
vm_screen_prepare(vm_screen *scr) vm_screen_prepare(vm_screen *scr)
{ {
//SDL_RenderClear(scr->render); SDL_RenderClear(scr->render);
} }
/* /*