#ifndef BLANK_APP_APPLICATION_HPP_
#define BLANK_APP_APPLICATION_HPP_
-#include "init.hpp"
-#include "RandomWalk.hpp"
-#include "../graphics/BlockLighting.hpp"
-#include "../graphics/Camera.hpp"
-#include "../graphics/DirectionalLighting.hpp"
+#include "Assets.hpp"
+#include "FrameCounter.hpp"
+#include "../ai/Spawner.hpp"
+#include "../audio/Audio.hpp"
+#include "../graphics/Viewport.hpp"
#include "../ui/Interface.hpp"
#include "../world/World.hpp"
+#include <SDL.h>
+
namespace blank {
+class Window;
+
class Application {
public:
World::Config world = World::Config();
};
- explicit Application(const Config &);
+ Application(Window &, const Config &);
+ ~Application();
Application(const Application &) = delete;
Application &operator =(const Application &) = delete;
/// process all events in SDL's queue
void HandleEvents();
+ void Handle(const SDL_WindowEvent &);
/// integrate to the next step with dt milliseconds passed
void Update(int dt);
/// push the current state to display
void Render();
- static Entity &MakeTestEntity(World &);
-
private:
- InitSDL init_sdl;
- InitIMG init_img;
- InitTTF init_ttf;
- InitGL init_gl;
- Window window;
- GLContext ctx;
- InitGLEW init_glew;
- BlockLighting chunk_prog;
- DirectionalLighting entity_prog;
-
- Camera cam;
+ Window &window;
+ Viewport viewport;
+ Assets assets;
+ Audio audio;
+ FrameCounter counter;
+
World world;
Interface interface;
- RandomWalk test_controller;
+ Spawner spawner;
bool running;