Main Page Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages

# OgreGLATIFSInit.cpp

Go to the documentation of this file.

    00001 /*
    00002     ATI fragment shader Extension program file.
    00003     setup by NFZ
    00004     extracted from ATI 8500 SDK
    00005
    00006 ** GL_ATI_fragment_shader
    00007 **
    00008 ** Support:
    00009 **   Rage 128 * based  : Not Supported
    00010 **   Radeon   * based  : Not Supported
    00011 **   R200     * based  : Supported
    00012 **   R200 : 8500, 9000, 9100, 9200
    00013 **   also works on R300 but pointless since ARBFP1.0 supported
    00014 */
    00015
    00016 #include "OgreGLATIFSInit.h"
    00017 #include "OgreGLPrerequisites.h"
    00018
    00019 // ATI_fragment_program functions
    00020 PFNGLGENFRAGMENTSHADERSATIPROC        glGenFragmentShadersATI_ptr=NULL;
    00021 PFNGLBINDFRAGMENTSHADERATIPROC        glBindFragmentShaderATI_ptr=NULL;
    00022 PFNGLDELETEFRAGMENTSHADERATIPROC      glDeleteFragmentShaderATI_ptr=NULL;
    00023 PFNGLBEGINFRAGMENTSHADERATIPROC       glBeginFragmentShaderATI_ptr=NULL;
    00024 PFNGLENDFRAGMENTSHADERATIPROC         glEndFragmentShaderATI_ptr=NULL;
    00025 PFNGLPASSTEXCOORDATIPROC              glPassTexCoordATI_ptr=NULL;
    00026 PFNGLSAMPLEMAPATIPROC                 glSampleMapATI_ptr=NULL;
    00027 PFNGLCOLORFRAGMENTOP1ATIPROC          glColorFragmentOp1ATI_ptr=NULL;
    00028 PFNGLCOLORFRAGMENTOP2ATIPROC          glColorFragmentOp2ATI_ptr=NULL;
    00029 PFNGLCOLORFRAGMENTOP3ATIPROC          glColorFragmentOp3ATI_ptr=NULL;
    00030 PFNGLALPHAFRAGMENTOP1ATIPROC          glAlphaFragmentOp1ATI_ptr=NULL;
    00031 PFNGLALPHAFRAGMENTOP2ATIPROC          glAlphaFragmentOp2ATI_ptr=NULL;
    00032 PFNGLALPHAFRAGMENTOP3ATIPROC          glAlphaFragmentOp3ATI_ptr=NULL;
    00033 PFNGLSETFRAGMENTSHADERCONSTANTATIPROC glSetFragmentShaderConstantATI_ptr=NULL;
    00034
    00035 bool InitATIFragmentShaderExtensions(Ogre::GLSupport& glSupport)
    00036 {
    00037     static bool init = false;
    00038     //char *extList;
    00039
    00040     if(init) return init;
    00041
    00042
    00043     /* confirm that the version of OpenGL supports ATI fragment shader */
    00044     /* done in GLRenderSystem
    00045     extList = (char *)glGetString(GL_EXTENSIONS);
    00046
    00047     if (strstr(extList, "GL_ATI_fragment_shader") == NULL)  {
    00048         //MessageBox(NULL, "GL_ATI_fragment_shader extension not supported", "GL Extension error", MB_OK);
    00049         // ** should raise exception
    00050         init = false;
    00051         return false;
    00052     }
    00053
    00054     */
    00055
    00056
    00057     glGenFragmentShadersATI_ptr    = (PFNGLGENFRAGMENTSHADERSATIPROC) glSupport.getProcAddress("glGenFragmentShadersATI");
    00058     glBindFragmentShaderATI_ptr    = (PFNGLBINDFRAGMENTSHADERATIPROC) glSupport.getProcAddress("glBindFragmentShaderATI");
    00059     glDeleteFragmentShaderATI_ptr  = (PFNGLDELETEFRAGMENTSHADERATIPROC) glSupport.getProcAddress("glDeleteFragmentShaderATI");
    00060     glBeginFragmentShaderATI_ptr   = (PFNGLBEGINFRAGMENTSHADERATIPROC) glSupport.getProcAddress("glBeginFragmentShaderATI");
    00061     glEndFragmentShaderATI_ptr     = (PFNGLENDFRAGMENTSHADERATIPROC) glSupport.getProcAddress("glEndFragmentShaderATI");
    00062     glPassTexCoordATI_ptr          = (PFNGLPASSTEXCOORDATIPROC) glSupport.getProcAddress("glPassTexCoordATI");
    00063     glSampleMapATI_ptr             = (PFNGLSAMPLEMAPATIPROC) glSupport.getProcAddress("glSampleMapATI");
    00064     glColorFragmentOp1ATI_ptr      = (PFNGLCOLORFRAGMENTOP1ATIPROC) glSupport.getProcAddress("glColorFragmentOp1ATI");
    00065     glColorFragmentOp2ATI_ptr      = (PFNGLCOLORFRAGMENTOP2ATIPROC) glSupport.getProcAddress("glColorFragmentOp2ATI");
    00066     glColorFragmentOp3ATI_ptr      = (PFNGLCOLORFRAGMENTOP3ATIPROC) glSupport.getProcAddress("glColorFragmentOp3ATI");
    00067     glAlphaFragmentOp1ATI_ptr      = (PFNGLALPHAFRAGMENTOP1ATIPROC) glSupport.getProcAddress("glAlphaFragmentOp1ATI");
    00068     glAlphaFragmentOp2ATI_ptr      = (PFNGLALPHAFRAGMENTOP2ATIPROC) glSupport.getProcAddress("glAlphaFragmentOp2ATI");
    00069     glAlphaFragmentOp3ATI_ptr      = (PFNGLALPHAFRAGMENTOP3ATIPROC) glSupport.getProcAddress("glAlphaFragmentOp3ATI");
    00070     glSetFragmentShaderConstantATI_ptr = (PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) glSupport.getProcAddress("glSetFragmentShaderConstantATI");
    00071
    00072     if (glGenFragmentShadersATI_ptr == NULL) return false;
    00073
    00074     if (glBindFragmentShaderATI_ptr == NULL) return false;
    00075
    00076     if (glDeleteFragmentShaderATI_ptr == NULL) return false;
    00077
    00078     if (glBeginFragmentShaderATI_ptr == NULL) return false;
    00079
    00080     if (glEndFragmentShaderATI_ptr == NULL) return false;
    00081
    00082     if (glPassTexCoordATI_ptr == NULL) return false;
    00083
    00084     if (glColorFragmentOp1ATI_ptr == NULL) return false;
    00085
    00086     if (glColorFragmentOp2ATI_ptr == NULL) return false;
    00087
    00088     if (glColorFragmentOp3ATI_ptr == NULL) return false;
    00089
    00090     if (glAlphaFragmentOp1ATI_ptr == NULL) return false;
    00091
    00092     if (glAlphaFragmentOp2ATI_ptr == NULL) return false;
    00093
    00094     if (glAlphaFragmentOp2ATI_ptr == NULL) return false;
    00095
    00096     if (glAlphaFragmentOp3ATI_ptr == NULL) return false;
    00097
    00098     if (glSetFragmentShaderConstantATI_ptr == NULL) return false;
    00099
    00100     init = true;
    00101
    00102     return true;
    00103 }
    00104

Copyright © 2002-2003 by The OGRE Team
Last modified Sun Nov 28 19:48:24 2004