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

glwindow.h

00001 /***************************************************************************
00002                           glwindow.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  ***************************************************************************/
00017 
00018 #ifndef GLWINDOW_H
00019 #define GLWINDOW_H
00020 
00021 #include <GL/gl.h>
00022 #include <iostream>
00023 #include "glcamera.h"
00024 #include "glrenderset.h"
00025 
00026 using namespace std;
00027 
00033 class GLWindow
00034 {
00035 protected:
00036    GLsizei width, height;
00037    int xPos, yPos;
00038    IRCPointer<GLRenderSet> camerasAndLights;
00039 
00040    inline void setRenderSet(GLRenderSet* rs)
00041    { camerasAndLights = rs; }
00042   
00043 public: 
00044    GLWindow(GLsizei w, GLsizei h, bool genRenderSet = true): width(w), height(h)
00045    {
00046       setPos(0,0);
00047       if(genRenderSet) camerasAndLights = new GLRenderSet(w,h);
00048    }
00049    
00050    virtual ~GLWindow() {}
00051 
00052    virtual void create(char* str, char** argv, int argc ) = 0;
00053 
00054    inline IRCPointer<GLRenderSet> getRenderSet() { return camerasAndLights; }
00055    inline GLScene::CameraPtr getCamera() { return camerasAndLights->getActiveCamera(); }
00056    
00057    inline void setSize(GLsizei w, GLsizei h) { width = w; height = h; }
00058    inline void setPos(int x, int y) { xPos = x; yPos = y; }
00059    inline void swapRenderSet(GLWindow* win)
00060    {
00061      IRCPointer<GLRenderSet> temp = camerasAndLights;
00062      camerasAndLights = win->camerasAndLights;
00063      win->camerasAndLights = temp;
00064    }
00065 
00066    inline void useCamera() { camerasAndLights->useCamera(); }
00067    inline void useLights() { camerasAndLights->useLights(); }
00068    inline void displayGrids() { camerasAndLights->displayGrids(); }
00069    
00071    const GLsizei getWidth() { return width; }
00072    const GLsizei getHeight() { return height; }
00073    const int getX() { return xPos; }
00074    const int getY() { return yPos; }
00075    
00076 };
00077 
00078 #endif

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