]>
git.saurik.com Git - wxWidgets.git/blob - samples/opengl/penguin/penguin.h
   1 ///////////////////////////////////////////////////////////////////////////// 
   3 // Purpose:     wxGLCanvas demo program 
   4 // Author:      Robert Roebling 
   8 // Copyright:   (c) Robert Roebling 
   9 // Licence:     wxWindows licence 
  10 ///////////////////////////////////////////////////////////////////////////// 
  12 #ifndef _WX_PENGUIN_H_ 
  13 #define _WX_PENGUIN_H_ 
  19 #include "wx/dcclient.h" 
  21 #include "wx/glcanvas.h" 
  26 #include "trackball.h" 
  29 /* information needed to display lightwave mesh */ 
  32 //  gint do_init;         /* true if initgl not yet called */ 
  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 */ 
  41 /* Define a new application type */ 
  42 class MyApp
: public wxApp
 
  48 /* Define a new frame type */ 
  51 class MyFrame
: public wxFrame
 
  54     MyFrame(wxFrame 
*frame
, const wxString
& title
, const wxPoint
& pos
, 
  55         const wxSize
& size
, long style 
= wxDEFAULT_FRAME_STYLE
); 
  57     void OnExit(wxCommandEvent
& event
); 
  60     void SetCanvas( TestGLCanvas 
*canvas 
) { m_canvas 
= canvas
; } 
  61     TestGLCanvas 
*GetCanvas() { return m_canvas
; } 
  64     TestGLCanvas 
*m_canvas
; 
  72 class TestGLCanvas
: public wxGLCanvas
 
  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")); 
  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 
); 
  96 #endif // #if wxUSE_GLCANVAS 
  98 #endif // #ifndef _WX_PENGUIN_H_