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

gluttglwindow.h

00001 /***************************************************************************
00002                           gluttglwindow.h  -  description
00003                              -------------------
00004     begin                : Wed Apr 30 2003
00005     copyright            : (C) 2003 by Jacques Gasselin De Richebourg
00006     email                : jgasseli@hotmail.com
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU Lesser General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  *   This library is distributed in the hope that it will be useful,       *
00017  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00018  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
00019  *   Lesser General Public License for more details.                       *
00020  *                                                                         *
00021  *   You should have received a copy of the GNU Lesser General Public      *
00022  *   License along with this library; if not, write to the Free Software   *
00023  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA *
00024  *                                                                         *
00025  ***************************************************************************/
00026 
00027 #ifndef GLUTTGLWINDOW_H
00028 #define GLUTTGLWINDOW_H
00029 
00030 #include <GL/glut.h>
00031 #include <iostream>
00032 #include <list>
00033 
00034 #include <TGL/tgl.h>
00035 
00036 
00037 using namespace std;
00038 
00046 //class GLUTTGLWindow;
00047 //#define WindowListType list<GLUTTGLWindow*>
00048 #define WindowListType list< RCPointer<GLUTTGLWindow> >
00049 
00050 class GLUTTGLWindow: public GLWindow
00051 {
00052 public:
00053    //only created once
00054    //but accessible to all
00055    static WindowListType windowList;
00056    static void displayFunc();
00057    static void reshapeFunc(GLsizei w, GLsizei h);
00058    static void mouseFunc(int b, int state, int x, int y);
00059    static void motionFunc(int x, int y);
00060    static void keyboardFunc(unsigned char key, int x, int y);
00061    static void idleFunc();
00062  
00063 protected:
00064 
00065    WindowListType childWindows;
00066    int windowTag;  //to communicate with GLUT
00067    int refreshRate;
00068    int frame;
00069    bool visible;
00070    
00071    GLfloat fov;   //frustrum settings
00072    GLfloat zNear;
00073    GLfloat zFar;
00074 
00075 public: 
00076    GLUTTGLWindow(GLsizei w, GLsizei h);
00077    ~GLUTTGLWindow();
00078 
00079    void resize();
00080    inline int getTag() { return windowTag; }
00081    inline void setVisibility(bool b) { visible = b; }
00082    inline void setRefreshRate(int rr) { refreshRate = rr; }
00083    virtual void create(char* str, char** argv, int argc );
00084    virtual void createSub(GLUTTGLWindow* parent);
00085 
00087    virtual void init();
00088    virtual void display();
00089    virtual void reshape(GLsizei w, GLsizei h);
00090    virtual void mouse(int b, int state, int x, int y);
00091    virtual void motion(int x, int y);
00092    virtual void keyboard(unsigned char key, int x, int y);
00093    virtual void idle();
00094 
00095    virtual void postRedisplay();
00096    virtual void beginScene();
00097    virtual void endScene();
00098 };
00099 
00100 #undef WindowListType
00101 
00102 #endif

Generated on Wed Feb 4 23:11:34 2004 by doxygen 1.3.3