diff options
author | David Phillips <dbphillipsnz@gmail.com> | 2016-01-12 20:45:53 +1300 |
---|---|---|
committer | David Phillips <dbphillipsnz@gmail.com> | 2016-01-12 20:45:53 +1300 |
commit | 3d5e998059750a66107663d8b18cc06b77a3bd10 (patch) | |
tree | eb5244546b7fb297eb7017245c71604e7cd5ec1b | |
parent | f6e2a11af09f17de17c2c711770e08e748c36aa7 (diff) | |
download | tetris-3d5e998059750a66107663d8b18cc06b77a3bd10.tar.xz |
Removed old files, hangovers from previous project
-rw-r--r-- | window.c | 44 | ||||
-rw-r--r-- | window.h | 20 |
2 files changed, 0 insertions, 64 deletions
diff --git a/window.c b/window.c deleted file mode 100644 index 2128f1c..0000000 --- a/window.c +++ /dev/null @@ -1,44 +0,0 @@ -#include "window.h" - -#include <SDL.h> - -int display_init(struct window *wobj) -{ - if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_TIMER) < 0) - { - fprintf(stderr,"Couldn't init SDL: %s\n", SDL_GetError()); - return EXIT_FAILURE; - } - - /* Create run-of-the-mill window at specified size */ - wobj->window = SDL_CreateWindow( - wobj->title, - SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, - wobj->width, wobj->height, - SDL_WINDOW_SHOWN - ); - if (wobj->window == NULL) - { - fprintf(stderr, "Couldn't create window: %s\n", SDL_GetError()); - return EXIT_FAILURE; - } - - /* Grab window surface */ - wobj->surface = SDL_GetWindowSurface(wobj->window); - if (wobj->surface == NULL) - { - fprintf(stderr, "Couldn't grab window surface: %s\n", SDL_GetError()); - return EXIT_FAILURE; - } - - /* Clear/blank surface with grey, and update it */ - SDL_FillRect(wobj->surface, NULL, SDL_MapRGB(wobj->surface->format, 0x33, 0x33, 0x33)); - SDL_UpdateWindowSurface(wobj->window); - return EXIT_SUCCESS; -} - -void display_stop(struct window *wobj) -{ - SDL_DestroyWindow(wobj->window); - SDL_Quit(); -} diff --git a/window.h b/window.h deleted file mode 100644 index 0c97b86..0000000 --- a/window.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef WINDOW_H -#define WINDOW_H - -#include <SDL.h> -#include <stdbool.h> - -struct window { - SDL_Window *window; - SDL_Renderer *renderer; - SDL_Surface *surface; - unsigned int height; - unsigned int width; - char* title; -}; - -int display_init(struct window *wobj); -void display_stop(struct window *wobj); - - -#endif |