2018-09-04 19:25:54 +00:00
|
|
|
#pragma once
|
|
|
|
|
2018-09-05 15:47:09 +00:00
|
|
|
#include "stdafx.h"
|
2018-09-04 19:25:54 +00:00
|
|
|
|
|
|
|
#include "vec2.h"
|
|
|
|
|
2018-09-05 23:10:38 +00:00
|
|
|
#include "GLFWInputManager.h"
|
2018-09-04 19:25:54 +00:00
|
|
|
#include "FPS.h"
|
|
|
|
|
2018-09-05 20:26:50 +00:00
|
|
|
using namespace egm;
|
|
|
|
|
2018-09-04 19:25:54 +00:00
|
|
|
// TODO: Close without rendering next frame.
|
|
|
|
|
|
|
|
class Application
|
|
|
|
{
|
|
|
|
public:
|
2018-09-05 23:10:38 +00:00
|
|
|
Application();
|
2018-09-05 06:49:02 +00:00
|
|
|
virtual ~Application();
|
2018-09-04 19:25:54 +00:00
|
|
|
|
|
|
|
int run();
|
2018-09-05 06:49:02 +00:00
|
|
|
|
2018-09-04 19:25:54 +00:00
|
|
|
protected:
|
|
|
|
// Called on initialization of the application (called by base_init)
|
2018-09-05 15:47:09 +00:00
|
|
|
virtual void init() = 0;
|
2018-09-04 19:25:54 +00:00
|
|
|
|
|
|
|
virtual void update(float delta_time, clock_t clock) = 0;
|
|
|
|
|
|
|
|
virtual void render() = 0;
|
|
|
|
|
|
|
|
// Called on closing of the application (called before base_close)
|
|
|
|
virtual void close();
|
|
|
|
|
2018-09-05 20:26:50 +00:00
|
|
|
GLFWwindow* m_p_window;
|
2018-09-04 19:25:54 +00:00
|
|
|
|
2018-09-05 23:10:38 +00:00
|
|
|
GLFWInputManager m_glfw_input_manager;
|
|
|
|
|
2018-09-04 19:25:54 +00:00
|
|
|
FPS m_fps;
|
|
|
|
private:
|
2018-09-05 15:47:09 +00:00
|
|
|
void base_init();
|
2018-09-04 19:25:54 +00:00
|
|
|
void base_close();
|
|
|
|
};
|
|
|
|
|