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