]>
Commit | Line | Data |
---|---|---|
aae24d21 RR |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: penguin.h | |
3 | // Purpose: wxGLCanvas demo program | |
4 | // Author: Robert Roebling | |
5 | // Modified by: | |
6 | // Created: 04/01/98 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Robert Roebling | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_PENGUIN_H_ | |
13 | #define _WX_PENGUIN_H_ | |
14 | ||
15 | ||
16 | #include "wx/defs.h" | |
17 | #include "wx/app.h" | |
18 | #include "wx/menu.h" | |
19 | #include "wx/dcclient.h" | |
20 | ||
21 | #include "glcanvas.h" | |
22 | ||
23 | extern "C" { | |
24 | #include "lw.h" | |
25 | #include "trackball.h" | |
26 | } | |
27 | ||
28 | /* information needed to display lightwave mesh */ | |
29 | typedef struct | |
30 | { | |
45b5751f JS |
31 | // gint do_init; /* true if initgl not yet called */ |
32 | int do_init; | |
aae24d21 RR |
33 | lwObject *lwobject; /* lightwave object mesh */ |
34 | float beginx,beginy; /* position of mouse */ | |
35 | float quat[4]; /* orientation of object */ | |
36 | float zoom; /* field of view in degrees */ | |
37 | } mesh_info; | |
38 | ||
39 | ||
40 | /* Define a new application type */ | |
41 | class MyApp: public wxApp | |
42 | { | |
43 | public: | |
44 | bool OnInit(void); | |
45 | }; | |
46 | ||
47 | /* Define a new frame type */ | |
48 | class TestGLCanvas; | |
49 | class MyFrame: public wxFrame | |
50 | { | |
51 | public: | |
52 | MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos, const wxSize& size, | |
53 | long style = wxDEFAULT_FRAME_STYLE); | |
54 | ||
55 | void OnExit(wxCommandEvent& event); | |
56 | bool OnClose(void); | |
57 | public: | |
58 | TestGLCanvas* m_canvas; | |
59 | ||
60 | DECLARE_EVENT_TABLE() | |
61 | }; | |
62 | ||
63 | ||
64 | class TestGLCanvas: public wxGLCanvas | |
65 | { | |
66 | public: | |
67 | TestGLCanvas(wxWindow *parent, const wxWindowID id = -1, const wxPoint& pos = wxDefaultPosition, | |
68 | const wxSize& size = wxDefaultSize, long style = 0, const wxString& name = "TestGLCanvas"); | |
69 | ~TestGLCanvas(void); | |
70 | ||
71 | void OnPaint(wxPaintEvent& event); | |
72 | void OnSize(wxSizeEvent& event); | |
73 | void OnEraseBackground(wxEraseEvent& event); | |
74 | void LoadLWO( const wxString &filename); | |
75 | void OnMouse( wxMouseEvent& event ); | |
76 | void InitGL(void); | |
77 | ||
78 | mesh_info info; | |
79 | bool block; | |
80 | ||
81 | DECLARE_EVENT_TABLE() | |
82 | }; | |
83 | ||
84 | #endif | |
85 |