Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ExampleOpenGLCanvas.hh
1 #include <Base/Common/W32Compat.hh>
2 
3 #include <Gui/OpenGLCanvas.hh>
4 #include <wx/wx.h>
5 
6 using namespace BIAS;
7 using namespace std;
8 
9 
10 /** \cond HIDDEN_SYMBOLS */
11 class ExampleOpenGLCanvasApp
12  : public /*wxApp*/ wxGLApp
13 {
14  virtual bool OnInit();
15 };
16 
17 enum _ExampleOpenGLCanvasMyFrameIDs_ {
18  ID_ABOUT=wxID_ABOUT,
19  ID_QUIT,
20  ID_TESTSHOT
21 };
22 
23 /**
24  * @example ExampleOpenGLCanvas.cpp
25  * @ingroup g_examples
26  * @brief Implement your own OpenGLCanvas derived class
27  * and override one of the Display functions
28  * to plug in your own GL calls / scene
29  * @author Jan Woetzel
30 */
31 class MyGLCanvas : public OpenGLCanvas {
32 public:
33  MyGLCanvas(wxFrame* parent);
34 
35  /// constructor using a shared context
36  MyGLCanvas(
37  wxFrame* parent
38  ,wxGLContext* sharedContext
39  ,wxWindowID id = -1
40  ,const wxPoint& pos = wxDefaultPosition
41  ,const wxSize& size = wxDefaultSize
42  ,long style=0
43  ,const wxString& name=wxT("MyGLCanvas sharedContext")
44  ,int* attribList = 0
45  ,const wxPalette& palette = wxNullPalette
46  );
47 
48  // override to fire our own Display calls:
49  void DisplayCalls();
50 
51 };
52 
53 // --------------------------------------------------------
54 class MyFrame: public wxFrame {
55 public:
56  MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size);
57  void OnQuit(wxCommandEvent& event);
58  void OnAbout(wxCommandEvent& event);
59 
60  void OnTestShot(wxCommandEvent& event);
61 
62  // data member ---
63  //BIAS::OpenGLCanvas * p_canvas;
64  MyGLCanvas * p_canvas;
65  //MyGLCanvas * p_2nd_canvas;
66 
67  DECLARE_EVENT_TABLE()
68 }; // end of MyFrame --------------------------------------
69 /** \endcond */
OpenGL canvases with additinal event handling (JW)
Definition: OpenGLCanvas.hh:68