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