1
0
mirror of https://github.com/pevans/erc-c.git synced 2024-12-13 00:29:03 +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
// drawing surface, but want to pretend we've added one.
#ifndef HEADLESS
screen->window = SDL_CreateWindow("erc",
SDL_WINDOWPOS_UNDEFINED,
SDL_WINDOWPOS_UNDEFINED,
width, height, 0);
SDL_CreateWindowAndRenderer(
width, height, 0, &screen->window, &screen->render);
if (screen->window == NULL) {
if (screen->window == NULL || screen->render == NULL) {
log_crit("Could not create window: %s", SDL_GetError());
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
// 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
vm_screen_prepare(vm_screen *scr)
{
//SDL_RenderClear(scr->render);
SDL_RenderClear(scr->render);
}
/*