00001 /* 00002 FGLMESA: An example of integrating FGL with Mesa for OpenGL programs 00003 Copyright (C) 1997 Sam Lantinga, 1999 Marian Krivos 00004 00005 OpenGUI - Drawing & Windowing library 00006 00007 Copyright (C) 1996,2004 Marian Krivos 00008 00009 This library is free software; you can redistribute it and/or 00010 modify it under the terms of the GNU Library General Public 00011 License as published by the Free Software Foundation; either 00012 version 2 of the License, or (at your option) any later version. 00013 00014 This library is distributed in the hope that it will be useful, 00015 but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 Library General Public License for more details. 00018 00019 You should have received a copy of the GNU Library General Public 00020 License along with this library; if not, write to the Free 00021 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00022 00023 Sam Lantinga 00024 5635-34 Springhouse Dr. 00025 Pleasanton, CA 94588 (USA) 00026 slouken@devolution.com 00027 00028 Marian Krivos 00029 nezmar@atlas.sk 00030 00031 $Id: fglmesa.h,v 1.1.1.1 2004/01/22 16:25:08 majo Exp $ 00032 00033 $Log: fglmesa.h,v $ 00034 Revision 1.1.1.1 2004/01/22 16:25:08 majo 00035 initial release 00036 00037 */ 00038 00039 #ifndef _FGL_Mesa_h 00040 #define _FGL_Mesa_h 00041 00042 #ifdef __BORLANDC__ 00043 #ifdef __linux__ 00044 #pragma link "FGMesa.a" 00045 #pragma link "libOSMesa.so" 00046 #pragma link "libGL.so" 00047 #else 00048 //#pragma link "MesaGL.lib"// don't work properly - buggy BC++ 6 linker???? 00049 #endif 00050 #endif 00051 00052 /* This integrates with Mesa using the OSMesa extensions for GL output */ 00053 #ifndef WINGDIAPI 00054 #define WINGDIAPI extern 00055 #define APIENTRY 00056 #endif 00057 00058 #include <GL/osmesa.h> 00059 00060 #ifdef FG_NAMESPACE 00061 namespace fgl { 00062 #endif 00063 00072 class GLSurface : public FGConnector 00073 { 00074 void *glsurface; 00075 OSMesaContext context; 00076 DrawBuffer *db; 00077 int h,w; 00078 int ok; 00079 int type; 00080 public: 00081 GLSurface(DrawBuffer *, int ww=0, int hh=0, bool direct_access=0); 00082 int MakeCurrent(void); 00083 void DestroyContext(void); 00084 void Draw(void); 00085 }; 00086 00087 #ifdef FG_NAMESPACE 00088 } 00089 #endif 00090 00091 #endif /* _FGL_Mesa_h */ 00092
1.4.0