]>
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"
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
43 // Define a new application type
44 class MyApp
: public wxApp
50 // Define a new frame type
53 class MyFrame
: public wxFrame
56 MyFrame(wxFrame
*frame
, const wxString
& title
, const wxPoint
& pos
,
57 const wxSize
& size
, long style
= wxDEFAULT_FRAME_STYLE
);
59 void OnMenuFileOpen(wxCommandEvent
& event
);
60 void OnMenuFileExit(wxCommandEvent
& event
);
61 void OnMenuHelpAbout(wxCommandEvent
& event
);
64 void SetCanvas( TestGLCanvas
*canvas
) { m_canvas
= canvas
; }
65 TestGLCanvas
*GetCanvas() { return m_canvas
; }
68 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"));
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();
99 DXFRenderer m_renderer
;
101 DECLARE_EVENT_TABLE()
104 #endif // #if wxUSE_GLCANVAS
106 #endif // #ifndef _WX_PENGUIN_H_