Switch from MVC (Model-View-Controller) pattern to a modified MVP (Model-View-Presenter) pattern, to toss out the inconvenient Controller
This commit is contained in:
Irlan
2018-04-12 19:25:00 -03:00
parent 7bec2853b1
commit 9d271cc5ed
6 changed files with 140 additions and 100 deletions

View File

@ -19,25 +19,43 @@
#ifndef VIEW_H
#define VIEW_H
#include <bounce/common/math/vec2.h>
#include <testbed/framework/presenter.h>
struct GLFWwindow;
class Model;
class View
{
{
public:
View(GLFWwindow* window, Model* model);
~View();
void Event_SetWindowSize(int w, int h);
void Event_Press_Key(int button);
void Event_Release_Key(int button);
void Event_Press_Mouse(int button);
void Event_Release_Mouse(int button);
void Event_Move_Cursor(float x, float y);
void Event_Scroll(float dx, float dy);
void Command_PreDraw();
void Command_Draw();
void Command_PostDraw();
private:
GLFWwindow * m_window;
friend class Presenter;
Presenter m_presenter;
Model* m_model;
GLFWwindow* m_window;
bool m_leftDown;
bool m_rightDown;
bool m_shiftDown;
b3Vec2 m_ps0;
// Ray3 m_ray0;
};
#endif