2048-homework/gui.c

38 lines
756 B
C

#include "gui.h"
#include "SDL.h"
const SCREEN_WIDTH = 800;
const SCREEN_HEIGHT = 600;
SDL_Window* window = NULL;
SDL_Surface* screenSurface = NULL;
void gui_init() {
//Initialize SDL
if( SDL_Init( SDL_INIT_VIDEO ) < 0 )
{
printf( "SDL could not initialize! SDL_Error: %s\n", SDL_GetError() );
}
window = SDL_CreateWindow( "2048", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_SHOWN );
if( window == NULL )
{
printf( "Window could not be created! SDL_Error: %s\n", SDL_GetError() );
}
}
void gui_destroy () {
//Destroy window
SDL_DestroyWindow( window );
//Quit SDL subsystems
SDL_Quit();
}
void gui_loop(Game *game) {
sleep(2000);
}