]> git.saurik.com Git - wxWidgets.git/blame - samples/opengl/isosurf/isosurf.h
Add wxRibbonButtonBar::GetItem(), GetItemById() and GetItemId().
[wxWidgets.git] / samples / opengl / isosurf / isosurf.h
CommitLineData
8b089c5e
JS
1/////////////////////////////////////////////////////////////////////////////
2// Name: isosurf.h
3// Purpose: wxGLCanvas demo program
4// Author: Brian Paul (original gltk version), Wolfram Gloger
5// Modified by: Julian Smart
6// Created: 04/01/98
7// RCS-ID: $Id$
8// Copyright: (c) Julian Smart
2f6c54eb 9// Licence: wxWindows licence
8b089c5e
JS
10/////////////////////////////////////////////////////////////////////////////
11
12#ifndef _WX_ISOSURF_H_
13#define _WX_ISOSURF_H_
14
6c7f0949
FM
15// we need OpenGL headers for GLfloat/GLint types used below
16#if defined(__WXMAC__) || defined(__WXCOCOA__)
17# ifdef __DARWIN__
18# include <OpenGL/gl.h>
19# include <OpenGL/glu.h>
20# else
21# include <gl.h>
22# include <glu.h>
23# endif
24#else
25# include <GL/gl.h>
26# include <GL/glu.h>
27#endif
28
29// the maximum number of vertex in the loaded .dat file
30#define MAXVERTS 10000
31
32
8b089c5e 33// Define a new application type
451c13c8 34class MyApp : public wxApp
5cf036d0
DS
35{
36public:
451c13c8 37 virtual bool OnInit();
6c7f0949
FM
38
39 virtual void OnInitCmdLine(wxCmdLineParser& parser);
40 virtual bool OnCmdLineParsed(wxCmdLineParser& parser);
8b089c5e
JS
41};
42
5cf036d0 43
6c7f0949 44// The OpenGL-enabled canvas
451c13c8 45class TestGLCanvas : public wxGLCanvas
8b089c5e 46{
5cf036d0 47public:
451c13c8
VZ
48 TestGLCanvas(wxWindow *parent,
49 wxWindowID id = wxID_ANY,
451c13c8 50 int *gl_attrib = NULL);
8b089c5e 51
451c13c8 52 virtual ~TestGLCanvas();
5cf036d0
DS
53
54 void OnPaint(wxPaintEvent& event);
55 void OnSize(wxSizeEvent& event);
5cf036d0
DS
56 void OnChar(wxKeyEvent& event);
57 void OnMouseEvent(wxMouseEvent& event);
58
6c7f0949
FM
59 void LoadSurface(const wxString& filename);
60 void InitMaterials();
61 void InitGL();
451c13c8
VZ
62
63private:
64 wxGLContext* m_glRC;
65
6c7f0949
FM
66 GLfloat m_verts[MAXVERTS][3];
67 GLfloat m_norms[MAXVERTS][3];
68 GLint m_numverts;
69
70 GLfloat m_xrot;
71 GLfloat m_yrot;
72
c0c133e1 73 wxDECLARE_NO_COPY_CLASS(TestGLCanvas);
5cf036d0 74 DECLARE_EVENT_TABLE()
8b089c5e 75};
5cf036d0 76
8b089c5e 77
6c7f0949 78// The frame containing the GL canvas
451c13c8 79class MyFrame : public wxFrame
8b089c5e
JS
80{
81public:
451c13c8
VZ
82 MyFrame(wxFrame *frame,
83 const wxString& title,
0c1c1c71
FM
84 const wxPoint& pos = wxDefaultPosition,
85 const wxSize& size = wxDefaultSize,
451c13c8 86 long style = wxDEFAULT_FRAME_STYLE);
5cf036d0
DS
87
88 virtual ~MyFrame();
8b089c5e 89
5cf036d0 90 TestGLCanvas *m_canvas;
8b089c5e 91
5cf036d0 92private :
5cf036d0
DS
93 void OnExit(wxCommandEvent& event);
94
451c13c8 95 DECLARE_EVENT_TABLE()
8b089c5e
JS
96};
97
6c7f0949 98
451c13c8 99#endif // _WX_ISOSURF_H_
8b089c5e 100