Changeset 81d7cdc in buchla-emu for emu/lcd.c


Ignore:
Timestamp:
09/09/2017 03:16:51 PM (7 years ago)
Author:
Thomas Lopatic <thomas@…>
Branches:
master
Children:
18cbd53
Parents:
1b30217
Message:

Support LCD buttons.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • emu/lcd.c

    r1b30217 r81d7cdc  
    6464
    6565static SDL_Window *win;
     66uint32_t lcd_win;
     67
    6668static SDL_Renderer *ren;
    6769static SDL_atomic_t frame;
     
    116118        for (int32_t y = 0; y < TXT_H; ++y) {
    117119                char line[TXT_W + 1];
     120                line[TXT_W] = 0;
    118121
    119122                if (SDL_LockMutex(cpu_mutex) < 0) {
     
    132135                        }
    133136                }
    134 
    135                 line[TXT_W] = 0;
    136137
    137138                SDL_Surface *lin = TTF_RenderText_Blended(fon, line, TXT_FGR);
     
    207208        }
    208209
     210        lcd_win = SDL_GetWindowID(win);
     211
     212        if (lcd_win == 0) {
     213                fail("SDL_GetWindowID() failed: %s", SDL_GetError());
     214        }
     215
    209216        ren = SDL_CreateRenderer(win, -1, 0);
    210217
Note: See TracChangeset for help on using the changeset viewer.