diff options
author | Alex Szpakowski <slime73@gmail.com> | 2017-08-15 23:00:54 -0300 |
---|---|---|
committer | Alex Szpakowski <slime73@gmail.com> | 2017-08-15 23:00:54 -0300 |
commit | 3a3d67f86288aabfb583ad3bfbcda9096b5728de (patch) | |
tree | 431db7beb0fc21fe0f32ea1f5c30b994902b6efd /Xcode-iOS | |
parent | 86ed4c9ebb8da57d66117c4cd1fb7b9a10ac75ef (diff) |
More cleanup of the iOS keyboard demo.
Diffstat (limited to 'Xcode-iOS')
-rw-r--r-- | Xcode-iOS/Demos/src/keyboard.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/Xcode-iOS/Demos/src/keyboard.c b/Xcode-iOS/Demos/src/keyboard.c index 86b5f1ea3c..4227c19246 100644 --- a/Xcode-iOS/Demos/src/keyboard.c +++ b/Xcode-iOS/Demos/src/keyboard.c @@ -157,7 +157,6 @@ drawGlyph(int glyph, int positionIndex) SDL_Texture* loadFont(void) { - SDL_Surface *surface = SDL_LoadBMP("kromasky_16x16.bmp"); if (!surface) { @@ -208,18 +207,18 @@ draw() int main(int argc, char *argv[]) { - int index; /* index of last key we pushed in the bitmap font */ SDL_Window *window; SDL_Event event; /* last event received */ SDL_Scancode scancode; /* scancode of last key we pushed */ int width; int height; + int done; if (SDL_Init(SDL_INIT_VIDEO) < 0) { printf("Error initializing SDL: %s", SDL_GetError()); } /* create window */ - window = SDL_CreateWindow("iPhone keyboard test", 0, 0, 320, 480, SDL_WINDOW_ALLOW_HIGHDPI); + window = SDL_CreateWindow("iOS keyboard test", 0, 0, 320, 480, SDL_WINDOW_ALLOW_HIGHDPI); /* create renderer */ renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_PRESENTVSYNC); @@ -229,16 +228,13 @@ main(int argc, char *argv[]) /* load up our font */ loadFont(); - int done = 0; - + done = 0; while (!done) { while (SDL_PollEvent(&event)) { switch (event.type) { case SDL_QUIT: done = 1; break; - case SDL_TEXTINPUT: - break; case SDL_KEYDOWN: if (event.key.keysym.scancode == SDL_SCANCODE_BACKSPACE) { if (numChars > 0) { @@ -269,5 +265,6 @@ main(int argc, char *argv[]) SDL_DestroyTexture(texture); SDL_DestroyRenderer(renderer); SDL_DestroyWindow(window); + SDL_Quit(); return 0; } |