1 #ifndef __CONTEXTWX_HH__
2 #define __CONTEXTWX_HH__
4 #include <bias_config.h>
5 #include <Gui/biasgl.h>
7 #ifndef BIAS_HAVE_WXWIDGETS
8 # error Your BIAS needs WX. Please recompile BIAS with USE_WXWIDGETS.
11 #include <Base/Common/BIASpragmaStart.hh>
13 #include <wx/glcanvas.h>
14 #include <Base/Common/BIASpragmaEnd.hh>
16 #include "RenderContextBase.hh"
19 #if !(defined(wxUSE_GLCANVAS) && wxUSE_GLCANVAS)
20 # error WX has not been compiled with wxUSE_GLCANVAS. Please set it in wx/setup.h and recompile WX.
31 class BIASGLviewer_EXPORT
ContextWX :
public wxGLCanvas,
35 static int defaultAttribs[];
38 const wxPoint& pos = wxDefaultPosition,
39 const wxSize& size = wxDefaultSize,
40 long style = 0,
const wxString& name = wxT(
"GLCanvas"),
41 int* attribList = defaultAttribs,
42 const wxPalette& palette = wxNullPalette);
53 int FindWorkingDisplayConfiguration();
57 virtual void MakeGLContextCurrent();
62 virtual void SetTimer(
unsigned int interval);
64 virtual void DeactivateTimer();
72 virtual void OnPaint(wxPaintEvent& event);
76 virtual void OnLeftDown(wxMouseEvent& event);
77 virtual void OnLeftUp(wxMouseEvent& event);
78 virtual void OnMiddleDown(wxMouseEvent& event);
79 virtual void OnMiddleUp(wxMouseEvent& event);
80 virtual void OnRightDown(wxMouseEvent& event);
81 virtual void OnRightUp(wxMouseEvent& event);
82 virtual void OnLeftDClick(wxMouseEvent& event);
83 virtual void OnRightDClick(wxMouseEvent& event);
84 virtual void OnMotion(wxMouseEvent& event);
85 virtual void OnEnterWindow(wxMouseEvent& event);
86 virtual void OnLeaveWindow(wxMouseEvent& event);
87 virtual void OnSize(wxSizeEvent& event);
88 virtual void OnKey(wxKeyEvent& event);
89 virtual void OnKeyDown(wxKeyEvent& event);
90 virtual void OnKeyUp(wxKeyEvent& event);
91 virtual void OnTimer(wxTimerEvent& event);
92 virtual void OnEraseBG(wxEraseEvent& event);
94 int _OldMouseX, _OldMouseY;
99 #if wxCHECK_VERSION(2, 9, 0)
100 wxGLContext* context_;
103 DECLARE_EVENT_TABLE()
108 #endif // __CONTEXTWX_HH__
Context implementation for wxWidgets.
virtual void Redisplay()
Demands a rendering from the Context;.
virtual void InitializationComplete()
Delay rendering until this method has been called.
Base for all classes creating interface between GL and "window manager".