Go to the documentation of this file.00001
00002 #ifndef vgui_glut_adaptor_h_
00003 #define vgui_glut_adaptor_h_
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include <vcl_vector.h>
00015 #include <vgui/vgui_adaptor.h>
00016 struct vgui_command;
00017 struct vgui_overlay_helper;
00018 struct vgui_glut_popup_impl;
00019
00020
00021 struct vgui_glut_adaptor : vgui_adaptor
00022 {
00023 vgui_glut_adaptor( vgui_window *win_, int id_ );
00024 ~vgui_glut_adaptor();
00025
00026 int get_id() const { return id; }
00027
00028
00029 vgui_window *get_window() const { return win; }
00030 void post_redraw();
00031 void post_overlay_redraw();
00032 void post_timer(float, int);
00033 void post_destroy();
00034 void swap_buffers();
00035 void make_current();
00036 void bind_popups(vgui_modifier ,vgui_button );
00037 unsigned get_width() const;
00038 unsigned get_height() const;
00039
00040 void get_popup_bindings(vgui_modifier &m, vgui_button &b) const
00041 { m = popup_modifier; b = popup_button; }
00042
00043 private:
00044 int id;
00045 vgui_window *win;
00046
00047 vgui_modifier popup_modifier;
00048 vgui_button popup_button;
00049
00050
00051
00052
00053
00054 bool ovl_established;
00055 vgui_overlay_helper *ovl_helper;
00056 void establish_overlays();
00057
00058
00059
00060
00061 bool glut_dispatch(vgui_event &e);
00062
00063
00064 void register_static_callbacks();
00065
00066
00067 vgui_glut_adaptor *super;
00068 vcl_vector<vgui_glut_adaptor*> sub_contexts;
00069
00070
00071 friend struct vgui_glut_popup_impl;
00072 vgui_glut_popup_impl *popup;
00073 void make_popup();
00074 static void pre_menu_hook(int );
00075
00076
00077
00078 virtual void display();
00079 virtual void overlay_display();
00080 virtual void reshape(int width,int height);
00081 virtual void keyboard(unsigned char,int,int);
00082 virtual void mouse(int button,int state,int x,int y);
00083 virtual void motion(int x,int y);
00084 virtual void passive_motion(int x,int y);
00085 virtual void entry(int);
00086 virtual void visibility(int state);
00087
00088 virtual void timer(int);
00089 virtual void special(int,int,int);
00090 virtual void keyboard_up(unsigned char,int,int);
00091 virtual void special_up(int,int,int);
00092
00093
00094 static vcl_vector<vgui_glut_adaptor*> &all();
00095 static vgui_glut_adaptor *get_adaptor(int window_id);
00096
00097
00098 static void display_callback();
00099 static void overlay_display_callback();
00100 static void reshape_callback(int width,int height);
00101 static void keyboard_callback(unsigned char,int,int);
00102 static void mouse_callback(int button,int state,int x,int y);
00103 static void motion_callback(int x,int y);
00104 static void passive_motion_callback(int x,int y);
00105 static void entry_callback(int);
00106 static void visibility_callback(int state);
00107
00108 static void timer_callback(int);
00109 static void special_callback(int,int,int);
00110 static void keyboard_up_callback(unsigned char,int,int);
00111 static void special_up_callback(int,int,int);
00112 static void menustatus_callback(int,int,int);
00113 };
00114
00115 #endif // vgui_glut_adaptor_h_