1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxGLCanvas demo program
4 // Author: Brian Paul (original gltk version), Wolfram Gloger
5 // Modified by: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #ifndef _WX_ISOSURF_H_
13 #define _WX_ISOSURF_H_
15 // we need OpenGL headers for GLfloat/GLint types used below
16 #if defined(__WXMAC__) || defined(__WXCOCOA__)
18 # include <OpenGL/gl.h>
19 # include <OpenGL/glu.h>
29 // the maximum number of vertex in the loaded .dat file
30 #define MAXVERTS 10000
33 // Define a new application type
34 class MyApp
: public wxApp
37 virtual bool OnInit();
39 virtual void OnInitCmdLine(wxCmdLineParser
& parser
);
40 virtual bool OnCmdLineParsed(wxCmdLineParser
& parser
);
44 // The OpenGL-enabled canvas
45 class TestGLCanvas
: public wxGLCanvas
48 TestGLCanvas(wxWindow
*parent
,
49 wxWindowID id
= wxID_ANY
,
50 int *gl_attrib
= NULL
);
52 virtual ~TestGLCanvas();
54 void OnPaint(wxPaintEvent
& event
);
55 void OnSize(wxSizeEvent
& event
);
56 void OnChar(wxKeyEvent
& event
);
57 void OnMouseEvent(wxMouseEvent
& event
);
59 void LoadSurface(const wxString
& filename
);
66 GLfloat m_verts
[MAXVERTS
][3];
67 GLfloat m_norms
[MAXVERTS
][3];
73 wxDECLARE_NO_COPY_CLASS(TestGLCanvas
);
78 // The frame containing the GL canvas
79 class MyFrame
: public wxFrame
82 MyFrame(wxFrame
*frame
,
83 const wxString
& title
,
84 const wxPoint
& pos
= wxDefaultPosition
,
85 const wxSize
& size
= wxDefaultSize
,
86 long style
= wxDEFAULT_FRAME_STYLE
);
90 TestGLCanvas
*m_canvas
;
93 void OnExit(wxCommandEvent
& event
);
99 #endif // _WX_ISOSURF_H_