1 | /*
|
---|
2 | ATI fragment shader Extension program file.
|
---|
3 | setup by NFZ
|
---|
4 | extracted from ATI 8500 SDK
|
---|
5 |
|
---|
6 | ** GL_ATI_fragment_shader
|
---|
7 | **
|
---|
8 | ** Support:
|
---|
9 | ** Rage 128 * based : Not Supported
|
---|
10 | ** Radeon * based : Not Supported
|
---|
11 | ** R200 * based : Supported
|
---|
12 | ** R200 : 8500, 9000, 9100, 9200
|
---|
13 | ** also works on R300 but pointless since ARBFP1.0 supported
|
---|
14 | */
|
---|
15 |
|
---|
16 | #include "OgreGLATIFSInit.h"
|
---|
17 | #include "OgreGLPrerequisites.h"
|
---|
18 |
|
---|
19 | // ATI_fragment_program functions
|
---|
20 | PFNGLGENFRAGMENTSHADERSATIPROC glGenFragmentShadersATI_ptr=NULL;
|
---|
21 | PFNGLBINDFRAGMENTSHADERATIPROC glBindFragmentShaderATI_ptr=NULL;
|
---|
22 | PFNGLDELETEFRAGMENTSHADERATIPROC glDeleteFragmentShaderATI_ptr=NULL;
|
---|
23 | PFNGLBEGINFRAGMENTSHADERATIPROC glBeginFragmentShaderATI_ptr=NULL;
|
---|
24 | PFNGLENDFRAGMENTSHADERATIPROC glEndFragmentShaderATI_ptr=NULL;
|
---|
25 | PFNGLPASSTEXCOORDATIPROC glPassTexCoordATI_ptr=NULL;
|
---|
26 | PFNGLSAMPLEMAPATIPROC glSampleMapATI_ptr=NULL;
|
---|
27 | PFNGLCOLORFRAGMENTOP1ATIPROC glColorFragmentOp1ATI_ptr=NULL;
|
---|
28 | PFNGLCOLORFRAGMENTOP2ATIPROC glColorFragmentOp2ATI_ptr=NULL;
|
---|
29 | PFNGLCOLORFRAGMENTOP3ATIPROC glColorFragmentOp3ATI_ptr=NULL;
|
---|
30 | PFNGLALPHAFRAGMENTOP1ATIPROC glAlphaFragmentOp1ATI_ptr=NULL;
|
---|
31 | PFNGLALPHAFRAGMENTOP2ATIPROC glAlphaFragmentOp2ATI_ptr=NULL;
|
---|
32 | PFNGLALPHAFRAGMENTOP3ATIPROC glAlphaFragmentOp3ATI_ptr=NULL;
|
---|
33 | PFNGLSETFRAGMENTSHADERCONSTANTATIPROC glSetFragmentShaderConstantATI_ptr=NULL;
|
---|
34 |
|
---|
35 | bool InitATIFragmentShaderExtensions(Ogre::GLSupport& glSupport)
|
---|
36 | {
|
---|
37 | static bool init = false;
|
---|
38 | //char *extList;
|
---|
39 |
|
---|
40 | if(init) return init;
|
---|
41 |
|
---|
42 |
|
---|
43 | /* confirm that the version of OpenGL supports ATI fragment shader */
|
---|
44 | /* done in GLRenderSystem
|
---|
45 | extList = (char *)glGetString(GL_EXTENSIONS);
|
---|
46 |
|
---|
47 | if (strstr(extList, "GL_ATI_fragment_shader") == NULL) {
|
---|
48 | //MessageBox(NULL, "GL_ATI_fragment_shader extension not supported", "GL Extension error", MB_OK);
|
---|
49 | // ** should raise exception
|
---|
50 | init = false;
|
---|
51 | return false;
|
---|
52 | }
|
---|
53 |
|
---|
54 | */
|
---|
55 |
|
---|
56 |
|
---|
57 | glGenFragmentShadersATI_ptr = (PFNGLGENFRAGMENTSHADERSATIPROC) glSupport.getProcAddress("glGenFragmentShadersATI");
|
---|
58 | glBindFragmentShaderATI_ptr = (PFNGLBINDFRAGMENTSHADERATIPROC) glSupport.getProcAddress("glBindFragmentShaderATI");
|
---|
59 | glDeleteFragmentShaderATI_ptr = (PFNGLDELETEFRAGMENTSHADERATIPROC) glSupport.getProcAddress("glDeleteFragmentShaderATI");
|
---|
60 | glBeginFragmentShaderATI_ptr = (PFNGLBEGINFRAGMENTSHADERATIPROC) glSupport.getProcAddress("glBeginFragmentShaderATI");
|
---|
61 | glEndFragmentShaderATI_ptr = (PFNGLENDFRAGMENTSHADERATIPROC) glSupport.getProcAddress("glEndFragmentShaderATI");
|
---|
62 | glPassTexCoordATI_ptr = (PFNGLPASSTEXCOORDATIPROC) glSupport.getProcAddress("glPassTexCoordATI");
|
---|
63 | glSampleMapATI_ptr = (PFNGLSAMPLEMAPATIPROC) glSupport.getProcAddress("glSampleMapATI");
|
---|
64 | glColorFragmentOp1ATI_ptr = (PFNGLCOLORFRAGMENTOP1ATIPROC) glSupport.getProcAddress("glColorFragmentOp1ATI");
|
---|
65 | glColorFragmentOp2ATI_ptr = (PFNGLCOLORFRAGMENTOP2ATIPROC) glSupport.getProcAddress("glColorFragmentOp2ATI");
|
---|
66 | glColorFragmentOp3ATI_ptr = (PFNGLCOLORFRAGMENTOP3ATIPROC) glSupport.getProcAddress("glColorFragmentOp3ATI");
|
---|
67 | glAlphaFragmentOp1ATI_ptr = (PFNGLALPHAFRAGMENTOP1ATIPROC) glSupport.getProcAddress("glAlphaFragmentOp1ATI");
|
---|
68 | glAlphaFragmentOp2ATI_ptr = (PFNGLALPHAFRAGMENTOP2ATIPROC) glSupport.getProcAddress("glAlphaFragmentOp2ATI");
|
---|
69 | glAlphaFragmentOp3ATI_ptr = (PFNGLALPHAFRAGMENTOP3ATIPROC) glSupport.getProcAddress("glAlphaFragmentOp3ATI");
|
---|
70 | glSetFragmentShaderConstantATI_ptr = (PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) glSupport.getProcAddress("glSetFragmentShaderConstantATI");
|
---|
71 |
|
---|
72 | if (glGenFragmentShadersATI_ptr == NULL) return false;
|
---|
73 |
|
---|
74 | if (glBindFragmentShaderATI_ptr == NULL) return false;
|
---|
75 |
|
---|
76 | if (glDeleteFragmentShaderATI_ptr == NULL) return false;
|
---|
77 |
|
---|
78 | if (glBeginFragmentShaderATI_ptr == NULL) return false;
|
---|
79 |
|
---|
80 | if (glEndFragmentShaderATI_ptr == NULL) return false;
|
---|
81 |
|
---|
82 | if (glPassTexCoordATI_ptr == NULL) return false;
|
---|
83 |
|
---|
84 | if (glColorFragmentOp1ATI_ptr == NULL) return false;
|
---|
85 |
|
---|
86 | if (glColorFragmentOp2ATI_ptr == NULL) return false;
|
---|
87 |
|
---|
88 | if (glColorFragmentOp3ATI_ptr == NULL) return false;
|
---|
89 |
|
---|
90 | if (glAlphaFragmentOp1ATI_ptr == NULL) return false;
|
---|
91 |
|
---|
92 | if (glAlphaFragmentOp2ATI_ptr == NULL) return false;
|
---|
93 |
|
---|
94 | if (glAlphaFragmentOp2ATI_ptr == NULL) return false;
|
---|
95 |
|
---|
96 | if (glAlphaFragmentOp3ATI_ptr == NULL) return false;
|
---|
97 |
|
---|
98 | if (glSetFragmentShaderConstantATI_ptr == NULL) return false;
|
---|
99 |
|
---|
100 | init = true;
|
---|
101 |
|
---|
102 | return true;
|
---|
103 | }
|
---|
104 |
|
---|