Main Page | Modules | Class List | File List | Class Members | File Members

openGL_texture.h

Go to the documentation of this file.
00001 
00014 /* This library is free software; you can redistribute it and/or
00015    modify it under the terms of the GNU Lesser General Public
00016    License as published by the Free Software Foundation; either
00017    version 2.1 of the License, or (at your option) any later version.
00018 
00019    This library is distributed in the hope that it will be useful,
00020    but WITHOUT ANY WARRANTY; without even the implied warranty of
00021    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00022    Lesser General Public License for more details.
00023 
00024    You should have received a copy of the GNU Lesser General Public
00025    License along with this library; if not, write to the Free Software
00026    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00027 */
00028 
00029 #ifndef _GAN_OPENGL_TEXTURE_H
00030 #define _GAN_OPENGL_TEXTURE_H
00031 
00032 #include <gandalf/image/image_defs.h>
00033 
00034 #ifdef HAVE_OPENGL
00035 
00036 #ifdef WIN32
00037         #include <windows.h>
00038 #endif
00039 
00040 #ifdef GCC_MAC
00041 #include <OpenGL/gl.h>
00042 #ifdef HAVE_OPENGL_EXT
00043 #include <OpenGL/glext.h>
00044 #endif
00045 #else
00046 #include <GL/gl.h>
00047 #ifdef HAVE_OPENGL_EXT
00048 #include <GL/glext.h>
00049 #endif
00050 #endif
00051 
00052 #ifdef __cplusplus
00053 extern "C" {
00054 #endif
00055 
00069 typedef struct OpenGLTextureStruct
00070 {
00071    int iTextureTileSize, iNumberOfTilesV, iNumberOfTilesH, iNumberOfTiles;
00072    GLuint *agluiTexture;
00073    Gan_Vector2_i *av2iTilePosition;
00074    GLenum eTextureMode;
00075 
00076 #ifdef HAVE_OPENGL_EXT
00077 #ifdef GL_ARB_shader_objects
00078    GLhandleARB PHandle;
00079 #endif
00080 #endif /* #ifdef HAVE_OPENGL_EXT */
00081 
00082    Gan_Bool bEnableBlending;
00083 } Gan_OpenGLTextureStruct;
00084 
00085 #ifdef HAVE_OPENGL_EXT
00086 
00089 typedef struct _Gan_GLExt_Function_Pointers
00090 {
00091    int setup;
00092    int error;
00093 
00094    PFNGLCOMPILESHADERARBPROC        fCompileShaderARB;
00095    PFNGLUNIFORM1IARBPROC            fUniform1iARB;
00096    PFNGLGETUNIFORMLOCATIONARBPROC   fGetUniformLocationARB;
00097    PFNGLACTIVETEXTUREPROC           fActiveTexture;
00098    PFNGLUSEPROGRAMOBJECTARBPROC     fUseProgramObjectARB;
00099    PFNGLLINKPROGRAMARBPROC          fLinkProgramARB;
00100    PFNGLATTACHOBJECTARBPROC         fAttachObjectARB;
00101    PFNGLGETINFOLOGARBPROC           fGetInfoLogARB;
00102    PFNGLGETOBJECTPARAMETERIVARBPROC fGetObjectParameterivARB;
00103    PFNGLSHADERSOURCEARBPROC         fShaderSourceARB;
00104    PFNGLCREATESHADEROBJECTARBPROC   fCreateShaderObjectARB;
00105    PFNGLCREATEPROGRAMOBJECTARBPROC  fCreateProgramObjectARB;
00106 
00107 } Gan_GLExt_Function_Pointers;
00108 
00109 void gan_initialise_glext_func_ptrs(Gan_GLExt_Function_Pointers* pExtFnPtrs);
00110 #endif
00111 
00112  Gan_Bool gan_build_openGL_textures_for_image ( Gan_Image *image, Gan_OpenGLTextureStruct *pOGLTexStruct );
00113  void     gan_free_openGL_textures_for_image ( Gan_OpenGLTextureStruct *pOGLTexStruct );
00114  Gan_Bool gan_render_openGL_textures_for_image ( Gan_OpenGLTextureStruct *pOGLTexStruct );
00115 
00124 #ifdef __cplusplus
00125 }
00126 #endif
00127 
00128 #endif /* #ifdef HAVE_OPENGL */
00129 
00130 #endif /* #ifndef _GAN_OPENGL_TEXTURE_H */

Generated on Fri Mar 17 12:44:48 2006 by  doxygen 1.3.9.1