00001 /*************************************************************************** 00002 sdltglwindow.h - description 00003 ------------------- 00004 begin : Thu Jan 15 2004 00005 copyright : (C) 2004 by Jacques Gasselin de Richebourg 00006 email : jacquesgasselin@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 SDLTGLWINDOW_H 00028 #define SDLTGLWINDOW_H 00029 00030 #include <TGL/tgl.h> 00031 #include <SDL/SDL.h> 00032 00037 class SDLTGLWindow : public GLWindow 00038 { 00039 SDL_Surface* screen; 00040 00041 bool doubleBuffered; 00042 00043 public: 00044 SDLTGLWindow(GLsizei w, GLsizei h, bool genRenderSet = true); 00045 ~SDLTGLWindow(); 00046 00047 inline SDL_Surface* getScreen( void ) const 00048 { return screen; } 00049 00051 virtual void create(char* str, char** argv, int argc); 00052 00053 virtual void init(); 00054 virtual void display(); 00055 virtual void reshape(GLsizei w, GLsizei h); 00056 virtual void mouse(int b, int state, int x, int y); 00057 virtual void motion(int x, int y); 00058 virtual void keyboard(unsigned char key, int x, int y); 00059 virtual void idle(); 00060 00061 virtual void postRedisplay(); 00062 virtual void beginScene(); 00063 virtual void endScene(); 00064 00065 }; 00066 00067 #endif