]> git.saurik.com Git - wxWidgets.git/blame - samples/opengl/penguin/penguin.h
Fixes to allow compilation with no wchar_t (djgpp probably has a real wchar_t
[wxWidgets.git] / samples / opengl / penguin / penguin.h
CommitLineData
8b089c5e
JS
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
2f6c54eb 9// Licence: wxWindows licence
8b089c5e
JS
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
5cf036d0
DS
23extern "C"
24{
8b089c5e
JS
25#include "lw.h"
26#include "trackball.h"
27}
28
29/* information needed to display lightwave mesh */
5cf036d0 30typedef struct
8b089c5e
JS
31{
32// gint do_init; /* true if initgl not yet called */
5cf036d0 33 bool do_init;
bcc4c541
RR
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 */
8b089c5e
JS
38} mesh_info;
39
40
41/* Define a new application type */
42class MyApp: public wxApp
43{
44public:
5cf036d0 45 bool OnInit();
8b089c5e
JS
46};
47
48/* Define a new frame type */
49class TestGLCanvas;
bcc4c541 50
8b089c5e
JS
51class MyFrame: public wxFrame
52{
53public:
5cf036d0
DS
54 MyFrame(wxFrame *frame, const wxString& title, const wxPoint& pos,
55 const wxSize& size, long style = wxDEFAULT_FRAME_STYLE);
8b089c5e
JS
56
57 void OnExit(wxCommandEvent& event);
5cf036d0 58
2db98bf5 59#if wxUSE_GLCANVAS
5cf036d0
DS
60 void SetCanvas( TestGLCanvas *canvas ) { m_canvas = canvas; }
61 TestGLCanvas *GetCanvas() { return m_canvas; }
62
bcc4c541 63private:
5cf036d0 64 TestGLCanvas *m_canvas;
2db98bf5 65#endif
8b089c5e 66
bcc4c541 67 DECLARE_EVENT_TABLE()
8b089c5e
JS
68};
69
2db98bf5
JS
70#if wxUSE_GLCANVAS
71
8b089c5e
JS
72class TestGLCanvas: public wxGLCanvas
73{
bcc4c541 74public:
5cf036d0
DS
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();
bcc4c541
RR
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 );
5cf036d0
DS
87 void InitGL();
88
bcc4c541
RR
89 mesh_info info;
90 bool block;
8b089c5e 91
bcc4c541
RR
92private:
93 DECLARE_EVENT_TABLE()
8b089c5e
JS
94};
95
5cf036d0 96#endif // #if wxUSE_GLCANVAS
8b089c5e 97
5cf036d0 98#endif // #ifndef _WX_PENGUIN_H_
2db98bf5 99