#ifndef MAIN_H
#define MAIN_H

#include <GLFW/glfw3.h>
#ifdef __APPLE__
#include <OpenGL/glu.h>
#include <OpenGL/gl.h>
// Tell Xcode IDE to not gripe about OpenGL deprecation
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
#else
#include <GL/glu.h>
#include <GL/gl.h>
#endif
#include <math.h>
#include <stdio.h>

#define SIZE_UNIT 2.0f
#define OFFSET_UNIT (SIZE_UNIT * 2)
#define STEVE_BASE (-(OFFSET_UNIT * 20))

#define S_TOROSO_WIDTH 8

#define S_LEG_ROWS 12 /* 10 pants + 2 shoes*/
#define S_LEG_WIDTH (S_TOROSO_WIDTH / 2)
#define S_LEG_DEPTH 4


#define S_CHEST_ROWS 12
#define S_CHEST_DEPTH S_LEG_DEPTH

#define S_ARM_WIDTH 4
#define S_ARM_DEPTH S_CHEST_DEPTH
#define S_ARM_SLEEVE_ROWS 4
#define S_ARM_SKIN_ROWS 8
#define S_ARM_ROWS (S_ARM_SLEEVE_ROWS + S_ARM_SKIN_ROWS)

#define S_HEAD_SIZE 8
#define S_HEAD_DEPTH 8

typedef struct
{
    GLint r;
    GLint g;
    GLint b;
} Color;

#define COLOR_SHOES (Color){107, 107, 107}
#define COLOR_PANTS (Color){70, 57, 164}
#define COLOR_SHIRT (Color){0, 175, 175}
#define COLOR_HAIR (Color){86, 36, 8}
#define COLOR_SKIN (Color){253, 193, 138}

#define FACE_EPSILON 0.001f

void draw_steve();
void drawCube(GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height, GLfloat depth, GLfloat angle, Color color);

#endif