-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathosgcanvas.hpp
44 lines (34 loc) · 1.23 KB
/
osgcanvas.hpp
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
#ifndef OSGCANVAS_HPP
#define OSGCANVAS_HPP
#include <wx/glcanvas.h>
#include <osgViewer/Viewer>
class osgCanvas : public wxGLCanvas, public osgViewer::GraphicsWindow
{
public:
osgCanvas(wxWindow *parent, wxWindowID id = wxID_ANY,
int *attributes = 0,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0,
const wxString& name = wxT("TestGLCanvas")
);
virtual ~osgCanvas();
void OnPaint(wxPaintEvent& event);
void grabFocusIfPointerInWindow();
void OnMouseDown(wxMouseEvent &event);
void OnMouseUp(wxMouseEvent &event);
void OnMouseMotion(wxMouseEvent &event);
void OnMouseWheel(wxMouseEvent& event);
void OnSize(wxSizeEvent& event);
void OnKeyDown(wxKeyEvent& event);
void OnKeyUp(wxKeyEvent& event);
void OnMouseEnter(wxMouseEvent& event);
wxGLContext* Context;
bool makeCurrentImplementation();
void swapBuffersImplementation();
virtual bool valid() const { return true; }
virtual bool realizeImplementation() { return true; }
virtual bool isRealizedImplementation() const { return IsShownOnScreen(); }
virtual void closeImplementation() {}
virtual bool releaseContextImplementation() { return true; }
};
#endif