Changeset bb4fd0c in buchla-emu for emu/sdl.c


Ignore:
Timestamp:
07/23/2017 10:17:42 AM (7 years ago)
Author:
Thomas Lopatic <thomas@…>
Branches:
master
Children:
a23f3d9
Parents:
a1fd5d5
Message:

Started serial console.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • emu/sdl.c

    ra1fd5d5 rbb4fd0c  
    2424#define ver3(...) _ver(sdl_verbose, 2, __VA_ARGS__)
    2525
     26SDL_Window *sdl_win;
     27SDL_Renderer *sdl_ren;
     28
    2629void sdl_init(void)
    2730{
     
    3639                fail("TTF_Init() failed: %s", TTF_GetError());
    3740        }
     41
     42        SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "1");
     43
     44        sdl_win = SDL_CreateWindow("Emu", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
     45                        WIN_W, WIN_H, 0);
     46
     47        if (sdl_win == NULL) {
     48                fail("SDL_CreateWindow() failed: %s", SDL_GetError());
     49        }
     50
     51        sdl_ren = SDL_CreateRenderer(sdl_win, -1, 0);
     52
     53        if (sdl_ren == NULL) {
     54                fail("SDL_CreateRenderer() failed: %s", SDL_GetError());
     55        }
     56
     57        SDL_StartTextInput();
    3858}
    3959
    4060void sdl_quit(void)
    4161{
     62        SDL_DestroyRenderer(sdl_ren);
     63        SDL_DestroyWindow(sdl_win);
    4264        TTF_Quit();
    4365        SDL_Quit();
Note: See TracChangeset for help on using the changeset viewer.