/* c-basic-offset: 2; tab-width: 2; indent-tabs-mode: nil
 * vi: set shiftwidth=2 tabstop=2 expandtab:
 * :indentSize=2:tabSize=2:noTabs=true:
 */

#ifndef __H_GAME__
#define __H_GAME__

#include <SDL2/SDL.h>
#include <stdbool.h>

#include "MousePointer.h"
#include "GameButton.h"
//#include "JSParser.h"
#include "game_utils.h"

/*
 * This file, as the rest of the project is under MIT license.
 * see http://opensource.org/licenses/MIT
 *
 * Author Gustav Hartvigsson <gustav.hartvigsson _at_ gmail.com> 2014
 */

#define J_SCALE_FACTOR 5000 //TODO: change tho momement to time-based



void quit (int rc);

typedef struct Game {
  SDL_Event event;
  SDL_Point mouse_delta;
  bool mouse_pressed;
  bool bg_colour_toggle;
  int done;
  SDL_Color background_colour;
  SDL_Window * window;
  SDL_Renderer * renderer;
  SDL_GameController * game_controller;
  MousePointer * mouse;
  GameButton * button;
} Game;

Game * game_new ();
void game_process_events (Game * self);
void game_main_loop (Game * self);
void game_free (Game * self);
void game_draw (Game * self);

#endif
