Main Page   Namespace List   Class Hierarchy   Compound List   File List   Compound Members   File Members  

GlutEngine.H

Go to the documentation of this file.
00001 
00009 #ifdef USE_GLUT
00010 
00011 #ifndef GLUTENGINE_H
00012 #define GLUTENGINE_H
00013 
00014 // inspace includes
00015 #include "ISVREngine.H"
00016 
00017 #define OUTSIDE_GLUE_CORE
00018 #include <mlib/points.H>
00019 
00020 class GlutEngine : public ISVREngine
00021 {
00022 public:
00023 
00024   static ISVREngine* createInstance(int argc, char **argv) {
00025     if (_instance == NULL)
00026       _instance = new GlutEngine(argc,argv);
00027     return _instance;
00028   }
00029 
00030   void run(ISApp *app);
00031 
00032   int maxScreenWidth();
00033   int maxScreenHeight();
00034 
00035 
00036   // these come from glut callbacks
00037   void draw();
00038   void reshape(int width, int height);
00039   void keyboard(unsigned char c, int x, int y);
00040   void keyboardspecial(int key, int x, int y);
00041   void keyboardup(unsigned char c, int x, int y);
00042   void keyboardspecialup(int key, int x, int y);
00043   void mousemotion(int x, int y);
00044   void mousebtn(int b, int s, int x, int y);
00045   
00046 protected:
00047   // call instance() rather than the constructor
00048   GlutEngine(int argc, char **argv);
00049   virtual ~GlutEngine();
00050 
00051   void setProjection(cWtransf &eye2room);
00052 
00053   str_ptr getKeyName(int key);
00054   str_ptr getKeyNameChar(unsigned char c);
00055   void sendKbdEvent(str_ptr keyname, bool down);
00056   str_list _downKeys;
00057 
00058   int  _drawcount;
00059   XYpt _lastPos;
00060   
00061   int    _argc;
00062   char **_argv;
00063 
00064   Wtransf _room2tile;
00065   double  _halftilew;
00066   double  _halftileh;
00067 
00068   double _nearclip;
00069   double _farclip;
00070 };
00071 
00072 #endif
00073 
00074 #endif // USE_GLUT

Generated on Mon Sep 15 16:27:55 2003 for inspace by doxygen1.2.18