summaryrefslogtreecommitdiff
path: root/engines/kokompe/kokompe/wysiwyg2d/view.h
blob: d3e46939fb14c0cd0c4ea766ea342ab0f15b4c15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#pragma once
class view;

#include "application.h"
#include "design.h"
#include "../engine/math_string_gl_texture.h"
#include "../math/vector2.h"

class view
{
    public:
		view(design& d, application& parent);
		~view();
		void close();
		void render();
		void keyboard_key(unsigned int key, int x, int y);
		void reshape(int width, int height);
		void mouse(int button, int state, int x, int y);
		void mouse_passive_move(int x, int y);
		void mouse_drag(int x, int y);
		void menu_select(int selection);
    private:
		int window_id;
		design* viewed_design;
		application* my_parent;

		double pixels_per_object_unit;
		_vector2<double> screen_center;

		_vector2<double> screen_upper_left();
		_vector2<double> screen_lower_right();
		
		_vector2<double> mouse_position;

		_vector2<double> mouse_to_object_space(int x, int y);
		
		_vector2<double> drag_start;
		control_object* dragged_control;
};