citrun

watch C/C++ source code execute
Log | Files | Refs | LICENSE

gl_view.h (1501B)


      1 #ifndef VIEW_H
      2 #define VIEW_H
      3 
      4 #include "demo-common.h"
      5 #include "gl_state.h"		// citrun::gl_state
      6 #include <GLFW/glfw3.h>
      7 
      8 class View {
      9 public:
     10 	View(citrun::gl_state &);
     11 	~View();
     12 
     13 	void reset();
     14 	void reshape_func(int, int);
     15 	void keyboard_func(GLFWwindow *, int, int, int, int);
     16 	void special_func(int key, int x, int y);
     17 	void mouse_func(int button, int state, int x, int y);
     18 	void motion_func(int x, int y);
     19 	void print_help();
     20 	void display(glyphy_extents_t const &);
     21 	void setup();
     22 
     23 	/* Animation */
     24 	bool animate;
     25 	int num_frames;
     26 	long fps_start_time;
     27 	bool has_fps_timer;
     28 	long last_frame_time;
     29 
     30 private:
     31 	void scale_gamma_adjust(double);
     32 	void scale_contrast(double);
     33 	void scale_perspective(double);
     34 	void toggle_outline();
     35 	void scale_outline_thickness(double);
     36 	void adjust_boldness(double);
     37 	void scale(double);
     38 	void translate(double, double);
     39 	void apply_transform(float *);
     40 	void toggle_fullscreen();
     41 	void toggle_debug();
     42 	void advance_frame(long);
     43 
     44 	unsigned int   refcount;
     45 
     46 	citrun::gl_state &st;
     47 
     48 	/* Output */
     49 	glyphy_bool_t fullscreen;
     50 
     51 	/* Mouse handling */
     52 	int buttons;
     53 	int modifiers;
     54 	bool dragged;
     55 	bool click_handled;
     56 	double beginx, beginy;
     57 	double lastx, lasty, lastt;
     58 	double dx,dy, dt;
     59 
     60 	/* Transformation */
     61 	float quat[4];
     62 	double scale_;
     63 	glyphy_point_t translate_;
     64 	double perspective;
     65 
     66 	/* Animation */
     67 	float rot_axis[3];
     68 	float rot_speed;
     69 
     70 	/* Window geometry just before going fullscreen */
     71 	int x;
     72 	int y;
     73 	int width;
     74 	int height;
     75 };
     76 
     77 #endif /* VIEW_H */