#ifndef __globals_h__
#define __globals_h__
#include <glm/glm.hpp>
#include <glm/glm.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/type_ptr.hpp>
#include "Wumbo-Header.h"
#include "Wumbo-Renderer.h"
#include "Wumbo-Shader.h"
#include "Batch.h"
#include "Rabbit.h"
#include "Globals.h"
#include "Level.h"


#if I_AM_THE_PROGRAM
#define GLOB
#else
#define GLOB extern
#endif



extern Batch *textbatch;
extern void draw_rectangle(int x, int y, int w, int h);
extern void draw_text(int x, int y, std::string text, int tricount = -1);




GLOB Batch *mdl_rabbit;
GLOB Batch *mdl_rabbit_shadow;
GLOB Batch *mdl_bird;
GLOB Batch *mdl_bird_shadow;

GLOB double music_null;
GLOB double music_underground;
GLOB double music_magic;
GLOB double music_outside;

GLOB std::vector<double> snd_voice_default;
GLOB std::vector<double> snd_voice_bird;
GLOB std::vector<double> snd_voice_scribble;

GLOB std::vector<double> snd_hop;
GLOB std::vector<double> snd_fall;
GLOB std::vector<double> snd_hardland;
GLOB std::vector<double> snd_whoosh;

extern void playLevelMusic(unsigned int type);
extern void stopAllMusic();

extern void ss_playsound_distort_vector(std::vector<double> *vec);
extern void ss_playsound_vector(std::vector<double> *vec);

const int WINDOW_WIDTH = 320;
const int WINDOW_HEIGHT = 480;
extern int WINDOW_SCALE;
extern Wumbo::Texture *tex;
extern Wumbo::Texture *title;
extern Wumbo::Texture *white;
extern Wumbo::Shader *megaShader;
extern void ss_playsound_distort(double soundid);

const unsigned int SHARECART_BLACK = 0xFF0A0C0B;
const unsigned int SHARECART_DARKBROWN = 0xFF322D23;
const unsigned int SHARECART_DARKGREEN = 0xFF1C4624;
const unsigned int SHARECART_DARKBLUE = 0xFF1C3E44;
const unsigned int SHARECART_DARKRED = 0xFF5F391F;
const unsigned int SHARECART_DARKYELLOW = 0xFF495441;
const unsigned int SHARECART_BLUE = 0xFF045C9C;
const unsigned int SHARECART_RED = 0xFF944A1C;
const unsigned int SHARECART_YELLOW = 0xFF94924C;
const unsigned int SHARECART_GREEN = 0xFF3C8844;
const unsigned int SHARECART_SKYBLUE = 0xFF04AECC;
const unsigned int SHARECART_GRAY = 0xFF909098;
const unsigned int SHARECART_TAN = 0xFFDCC67C;
const unsigned int SHARECART_LIGHTGREEN = 0xFFA4DAC4;
const unsigned int SHARECART_CYAN = 0xFF6CFADC;
const unsigned int SHARECART_WHITE = 0xFFFCFEFC;

const unsigned int SHARECART_COLORS[] = {SHARECART_BLACK,SHARECART_DARKBROWN,SHARECART_DARKGREEN,SHARECART_DARKBLUE,
										SHARECART_DARKRED,SHARECART_DARKYELLOW,SHARECART_BLUE,SHARECART_RED,SHARECART_YELLOW,
										SHARECART_GREEN, SHARECART_SKYBLUE, SHARECART_GRAY, SHARECART_TAN, SHARECART_LIGHTGREEN,
										SHARECART_CYAN, SHARECART_WHITE};

extern GLvoid glClearColor(unsigned int color);
extern GLint matrixUniformID;
extern glm::mat4x4 VIEW, PROJ;
extern glm::mat4x4 glmat;
extern GLvoid matrixBegin();
extern GLvoid matrixRotate(float degrees, float x, float y, float z);
extern GLvoid matrixTranslate(float x, float y, float z);
extern GLvoid matrixScale(float x, float y, float z);
extern GLvoid matrixUpload();
extern int degreemod(int degrees);
#endif