#ifndef ALL_H #define ALL_H #include #include #define GL_SILENCE_DEPRECATION #ifdef __APPLE__ #include #include #else #include #include #endif #ifndef M_PI #define M_PI 3.14159265358979323846 #endif typedef struct { float x, y, z; } Vec2; typedef struct { float x, y, z; } Vec3; typedef struct { float x, y, z, w; } Vec4; typedef struct { char format[3]; int width; int height; int color_space; unsigned char *pixels; } Image; typedef struct { int target_fps; int width; int height; int last_time; float x_offset; float y_offset; float cube_angle; GLuint texture_id; } Game; extern Game game; #define COLOR_RED (Vec3){ .x = 1.0f, .y = 0.0f, .z = 0.0f } #define COLOR_GREEN (Vec3){ .x = 0.0f, .y = 1.0f, .z = 0.0f } #define COLOR_BLUE (Vec3){ .x = 0.0f, .y = 0.0f, .z = 1.0f } #define COLOR_WHITE (Vec3){ .x = 1.0f, .y = 1.0f, .z = 1.0f } #define COLOR_BLACK (Vec3){ .x = 0.0f, .y = 0.0f, .z = 0.0f } #define COLOR_YELLOW (Vec3){ .x = 1.0f, .y = 1.0f, .z = 0.0f } #define COLOR_CYAN (Vec3){ .x = 0.0f, .y = 1.0f, .z = 1.0f } #define COLOR_MAGENTA (Vec3){ .x = 1.0f, .y = 0.0f, .z = 1.0f } #define COLOR_ORANGE (Vec3){ .x = 1.0f, .y = 0.5f, .z = 0.0f } #define COLOR_PURPLE (Vec3){ .x = 0.5f, .y = 0.0f, .z = 0.5f } Image read_ppm_image(const char *filename); void handle_keyboard_event(unsigned char key, int x, int y); void handle_mouse_event(int button, int state, int x, int y); #endif