]> git.saurik.com Git - wxWidgets.git/blob - samples/opengl/penguin/penguin.h
Change 'test -e' to 'test -f' for Sun
[wxWidgets.git] / samples / opengl / penguin / penguin.h
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 "wx/glcanvas.h"
22
23 extern "C"
24 {
25 #include "lw.h"
26 #include "trackball.h"
27 }
28
29 /* information needed to display lightwave mesh */
30 typedef struct
31 {
32 // gint do_init; /* true if initgl not yet called */
33 bool do_init;
34 lwObject *lwobject; /* lightwave object mesh */
35 float beginx,beginy; /* position of mouse */
36 float quat[4]; /* orientation of object */
37 float zoom; /* field of view in degrees */
38 } mesh_info;
39
40
41 /* Define a new application type */
42 class MyApp: public wxApp
43 {
44 public:
45 bool OnInit();
46 };
47
48 /* Define a new frame type */
49 class TestGLCanvas;
50
51 class MyFrame: public wxFrame
52 {
53 public:
54 MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos,
55 const wxSize& size, long style = wxDEFAULT_FRAME_STYLE);
56
57 void OnExit(wxCommandEvent& event);
58
59 #if wxUSE_GLCANVAS
60 void SetCanvas( TestGLCanvas *canvas ) { m_canvas = canvas; }
61 TestGLCanvas *GetCanvas() { return m_canvas; }
62
63 private:
64 TestGLCanvas *m_canvas;
65 #endif
66
67 DECLARE_EVENT_TABLE()
68 };
69
70 #if wxUSE_GLCANVAS
71
72 class TestGLCanvas: public wxGLCanvas
73 {
74 public:
75 TestGLCanvas(wxWindow *parent, wxWindowID id = wxID_ANY,
76 const wxPoint& pos = wxDefaultPosition,
77 const wxSize& size = wxDefaultSize, long style = 0,
78 const wxString& name = wxT("TestGLCanvas"));
79
80 ~TestGLCanvas();
81
82 void OnPaint(wxPaintEvent& event);
83 void OnSize(wxSizeEvent& event);
84 void OnEraseBackground(wxEraseEvent& event);
85 void LoadLWO( const wxString &filename);
86 void OnMouse( wxMouseEvent& event );
87 void InitGL();
88
89 mesh_info info;
90 bool block;
91
92 private:
93 DECLARE_EVENT_TABLE()
94 };
95
96 #endif // #if wxUSE_GLCANVAS
97
98 #endif // #ifndef _WX_PENGUIN_H_
99