Create window
Program creates an OpenGL window that can be resized or go fullscreen. Nothing drawn inside the window yet.
This commit is contained in:
25
src/main.c
25
src/main.c
@@ -1,6 +1,29 @@
|
||||
#include <stdio.h>
|
||||
#include "SDL2/SDL.h"
|
||||
#include "SDL2/SDL_timer.h"
|
||||
#include "game.h"
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
printf("Hello World!\n");
|
||||
printf("Starting...\n");
|
||||
GameState *gs = Game_New();
|
||||
|
||||
if (gs == NULL)
|
||||
{
|
||||
printf("Failed to start.\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
while (gs->running)
|
||||
{
|
||||
Game_Update(gs);
|
||||
SDL_Delay(100);
|
||||
}
|
||||
|
||||
printf("Shutting down...\n");
|
||||
Game_Destroy(gs);
|
||||
SDL_Quit();
|
||||
printf("Done.\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user