]>
git.saurik.com Git - wxWidgets.git/blob - samples/opengl/penguin/penguin.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxGLCanvas demo program
4 // Author: Robert Roebling
8 // Copyright: (c) Robert Roebling
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_PENGUIN_H_
13 #define _WX_PENGUIN_H_
19 #include "wx/dcclient.h"
20 #include "wx/wfstream.h"
22 #include "wx/zstream.h"
25 #include "wx/glcanvas.h"
29 #include "trackball.h"
32 #include "dxfrenderer.h"
38 bool initialized
; // have OpenGL been initialized?
39 float beginx
, beginy
; // position of mouse
40 float quat
[4]; // orientation of object
41 float zoom
; // field of view in degrees
45 // Define a new application type
46 class MyApp
: public wxApp
49 virtual bool OnInit();
53 // Define a new frame type
57 class MyFrame
: public wxFrame
60 MyFrame(wxFrame
*frame
, const wxString
& title
, const wxPoint
& pos
,
61 const wxSize
& size
, long style
= wxDEFAULT_FRAME_STYLE
);
63 void OnMenuFileOpen(wxCommandEvent
& event
);
64 void OnMenuFileExit(wxCommandEvent
& event
);
65 void OnMenuHelpAbout(wxCommandEvent
& event
);
67 void SetCanvas(TestGLCanvas
*canvas
) { m_canvas
= canvas
; }
68 TestGLCanvas
*GetCanvas() { return m_canvas
; }
71 TestGLCanvas
*m_canvas
;
77 class TestGLCanvas
: public wxGLCanvas
80 TestGLCanvas(wxWindow
*parent
, wxWindowID id
= wxID_ANY
,
81 const wxPoint
& pos
= wxDefaultPosition
,
82 const wxSize
& size
= wxDefaultSize
, long style
= 0,
83 const wxString
& name
= wxT("TestGLCanvas"));
85 virtual ~TestGLCanvas();
87 void LoadDXF(const wxString
& filename
);
90 void OnPaint(wxPaintEvent
& event
);
91 void OnSize(wxSizeEvent
& event
);
92 void OnEraseBackground(wxEraseEvent
& event
);
93 void OnMouse(wxMouseEvent
& event
);
97 void ResetProjectionMode();
101 DXFRenderer m_renderer
;
103 wxDECLARE_NO_COPY_CLASS(TestGLCanvas
);
104 DECLARE_EVENT_TABLE()
107 #endif // #ifndef _WX_PENGUIN_H_