]>
git.saurik.com Git - wxWidgets.git/blob - samples/opengl/isosurf/isosurf.h
1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxGLCanvas demo program
4 // Author: Brian Paul (original gltk version), Wolfram Gloger
5 // Modified by: Julian Smart
7 // Copyright: (c) Julian Smart
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_ISOSURF_H_
12 #define _WX_ISOSURF_H_
14 // we need OpenGL headers for GLfloat/GLint types used below
15 #if defined(__WXMAC__) || defined(__WXCOCOA__)
17 # include <OpenGL/gl.h>
18 # include <OpenGL/glu.h>
28 // the maximum number of vertex in the loaded .dat file
29 #define MAXVERTS 10000
32 // Define a new application type
33 class MyApp
: public wxApp
36 virtual bool OnInit();
38 virtual void OnInitCmdLine(wxCmdLineParser
& parser
);
39 virtual bool OnCmdLineParsed(wxCmdLineParser
& parser
);
43 // The OpenGL-enabled canvas
44 class TestGLCanvas
: public wxGLCanvas
47 TestGLCanvas(wxWindow
*parent
,
48 wxWindowID id
= wxID_ANY
,
49 int *gl_attrib
= NULL
);
51 virtual ~TestGLCanvas();
53 void OnPaint(wxPaintEvent
& event
);
54 void OnSize(wxSizeEvent
& event
);
55 void OnChar(wxKeyEvent
& event
);
56 void OnMouseEvent(wxMouseEvent
& event
);
58 void LoadSurface(const wxString
& filename
);
65 GLfloat m_verts
[MAXVERTS
][3];
66 GLfloat m_norms
[MAXVERTS
][3];
72 wxDECLARE_NO_COPY_CLASS(TestGLCanvas
);
77 // The frame containing the GL canvas
78 class MyFrame
: public wxFrame
81 MyFrame(wxFrame
*frame
,
82 const wxString
& title
,
83 const wxPoint
& pos
= wxDefaultPosition
,
84 const wxSize
& size
= wxDefaultSize
,
85 long style
= wxDEFAULT_FRAME_STYLE
);
89 TestGLCanvas
*m_canvas
;
92 void OnExit(wxCommandEvent
& event
);
98 #endif // _WX_ISOSURF_H_