#pragma once #include #include "fmod.hpp" #include #include "audioloop.h" #include "bufferfish.h" #include "gravityball.h" #include "deathball.h" #include "camera.h" #include "actor.h" class Game { public: static Game &get_singleton(); int main_loop(); /* audio instance vars */ /* these are public so that the audio callback can access them */ double* _audio_buffer; FMOD::System* _sound_sys; STShaderProgram* _shader; private: Game(); ~Game(); Game(const Game &); // intentionally undefined Game & operator=(const Game &);// intentionally undefined void init_gl(); int init_sdl(); int init_audio(); void init_scene(); /* callbacks */ void render(double tick_time); void update(double tick_time); void reshapeFunc(const SDL_ResizeEvent & resize_e); int keydown_event(const SDL_KeyboardEvent & keyboard_e); int keyup_event(const SDL_KeyboardEvent & keyboard_e); void mouse_down_event(const SDL_MouseButtonEvent & button_e); void mouse_up_event(const SDL_MouseButtonEvent & button_e); void mouse_motion_event(const SDL_MouseMotionEvent & motion_e); /* helpers */ void do_gl_projection(); void clean_up(); void draw_death_ball(); GravityBall* get_closest_ball(); void garbage_collect(); /* audio instance vars */ unsigned int _buffer_size; /* graphics instance vars */ int _window_width; int _window_height; bool _is_mouse_pressed; //TODO make this a linked list vector _actors; vector _buffer_fishes; vector _gravity_balls; Camera* _camera; DeathBall* _death_ball; };