+++ /dev/null
-//
-// main.c
-// Super Polarity
-//
-// Created by Ruben Beltran del Rio on 8/13/13.
-// Copyright (c) 2013 Abuguet. All rights reserved.
-//
-
-#include <stdio.h>
-#include <time.h>
-
-#include "SDL2/SDL.h"
-
-// TODO: Move these guys to a config header file
-#define SCREEN_WIDTH 640
-#define SCREEN_HEIGHT 480
-#define FPS 30
-
-int main(int argc, const char * argv[])
-{
-
- // SDL Initialization. TODO: Should have an initializer.
- SDL_Window *window;
- SDL_Renderer *renderer;
- Uint32 startFrame;
- Uint32 endFrame;
- Uint32 delay;
- int done;
-
- if (SDL_Init(SDL_INIT_VIDEO) < 0) {
- printf("Could not initialize SDL");
- exit(1);
- }
-
- window = SDL_CreateWindow("Super Polarity", 50, 50, SCREEN_WIDTH, SCREEN_HEIGHT, SDL_WINDOW_OPENGL | SDL_WINDOW_BORDERLESS);
-
- renderer = SDL_CreateRenderer(window, -1, 0);
-
- done = 0;
-
- // Event Loop.
- while (!done) {
- startFrame = SDL_GetTicks();
- SDL_Event event;
- while (SDL_PollEvent(&event)) {
- if (event.type == SDL_QUIT) {
- done = 1;
- }
- }
-
- endFrame = SDL_GetTicks();
-
- /* see if we have time to sleep */
- delay = 1000 / FPS - (endFrame - startFrame);
- if (delay > 1000 / FPS) {
- delay = 1000 / FPS;
- }
- SDL_Delay(delay);
- }
-
- SDL_Quit();
-
- return 0;
-}
-