]>
git.saurik.com Git - wxWidgets.git/blob - samples/opengl/penguin/penguin.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxGLCanvas demo program
4 // Author: Robert Roebling
7 // Copyright: (c) Robert Roebling
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_PENGUIN_H_
12 #define _WX_PENGUIN_H_
18 #include "wx/dcclient.h"
19 #include "wx/wfstream.h"
21 #include "wx/zstream.h"
24 #include "wx/glcanvas.h"
28 #include "trackball.h"
31 #include "dxfrenderer.h"
37 bool initialized
; // have OpenGL been initialized?
38 float beginx
, beginy
; // position of mouse
39 float quat
[4]; // orientation of object
40 float zoom
; // field of view in degrees
44 // Define a new application type
45 class MyApp
: public wxApp
48 virtual bool OnInit();
52 // Define a new frame type
56 class MyFrame
: public wxFrame
59 MyFrame(wxFrame
*frame
, const wxString
& title
, const wxPoint
& pos
,
60 const wxSize
& size
, long style
= wxDEFAULT_FRAME_STYLE
);
62 void OnMenuFileOpen(wxCommandEvent
& event
);
63 void OnMenuFileExit(wxCommandEvent
& event
);
64 void OnMenuHelpAbout(wxCommandEvent
& event
);
66 void SetCanvas(TestGLCanvas
*canvas
) { m_canvas
= canvas
; }
67 TestGLCanvas
*GetCanvas() { return m_canvas
; }
70 TestGLCanvas
*m_canvas
;
76 class TestGLCanvas
: public wxGLCanvas
79 TestGLCanvas(wxWindow
*parent
, wxWindowID id
= wxID_ANY
,
80 const wxPoint
& pos
= wxDefaultPosition
,
81 const wxSize
& size
= wxDefaultSize
, long style
= 0,
82 const wxString
& name
= wxT("TestGLCanvas"));
84 virtual ~TestGLCanvas();
86 void LoadDXF(const wxString
& filename
);
89 void OnPaint(wxPaintEvent
& event
);
90 void OnSize(wxSizeEvent
& event
);
91 void OnEraseBackground(wxEraseEvent
& event
);
92 void OnMouse(wxMouseEvent
& event
);
96 void ResetProjectionMode();
100 DXFRenderer m_renderer
;
102 wxDECLARE_NO_COPY_CLASS(TestGLCanvas
);
103 DECLARE_EVENT_TABLE()
106 #endif // #ifndef _WX_PENGUIN_H_