]> git.tdb.fi Git - libs/gl.git/blob - source/arb_multitexture.cpp
Add setup/finish_render hooks to Object
[libs/gl.git] / source / arb_multitexture.cpp
1 #include "arb_multitexture.h"
2
3 namespace Msp {
4 namespace GL {
5
6 PFNGLACTIVETEXTUREPROC glActiveTexture = 0;
7 PFNGLCLIENTACTIVETEXTUREPROC glClientActiveTexture = 0;
8 PFNGLMULTITEXCOORD1DPROC glMultiTexCoord1d = 0;
9 PFNGLMULTITEXCOORD1DVPROC glMultiTexCoord1dv = 0;
10 PFNGLMULTITEXCOORD1FPROC glMultiTexCoord1f = 0;
11 PFNGLMULTITEXCOORD1FVPROC glMultiTexCoord1fv = 0;
12 PFNGLMULTITEXCOORD1IPROC glMultiTexCoord1i = 0;
13 PFNGLMULTITEXCOORD1IVPROC glMultiTexCoord1iv = 0;
14 PFNGLMULTITEXCOORD1SPROC glMultiTexCoord1s = 0;
15 PFNGLMULTITEXCOORD1SVPROC glMultiTexCoord1sv = 0;
16 PFNGLMULTITEXCOORD2DPROC glMultiTexCoord2d = 0;
17 PFNGLMULTITEXCOORD2DVPROC glMultiTexCoord2dv = 0;
18 PFNGLMULTITEXCOORD2FPROC glMultiTexCoord2f = 0;
19 PFNGLMULTITEXCOORD2FVPROC glMultiTexCoord2fv = 0;
20 PFNGLMULTITEXCOORD2IPROC glMultiTexCoord2i = 0;
21 PFNGLMULTITEXCOORD2IVPROC glMultiTexCoord2iv = 0;
22 PFNGLMULTITEXCOORD2SPROC glMultiTexCoord2s = 0;
23 PFNGLMULTITEXCOORD2SVPROC glMultiTexCoord2sv = 0;
24 PFNGLMULTITEXCOORD3DPROC glMultiTexCoord3d = 0;
25 PFNGLMULTITEXCOORD3DVPROC glMultiTexCoord3dv = 0;
26 PFNGLMULTITEXCOORD3FPROC glMultiTexCoord3f = 0;
27 PFNGLMULTITEXCOORD3FVPROC glMultiTexCoord3fv = 0;
28 PFNGLMULTITEXCOORD3IPROC glMultiTexCoord3i = 0;
29 PFNGLMULTITEXCOORD3IVPROC glMultiTexCoord3iv = 0;
30 PFNGLMULTITEXCOORD3SPROC glMultiTexCoord3s = 0;
31 PFNGLMULTITEXCOORD3SVPROC glMultiTexCoord3sv = 0;
32 PFNGLMULTITEXCOORD4DPROC glMultiTexCoord4d = 0;
33 PFNGLMULTITEXCOORD4DVPROC glMultiTexCoord4dv = 0;
34 PFNGLMULTITEXCOORD4FPROC glMultiTexCoord4f = 0;
35 PFNGLMULTITEXCOORD4FVPROC glMultiTexCoord4fv = 0;
36 PFNGLMULTITEXCOORD4IPROC glMultiTexCoord4i = 0;
37 PFNGLMULTITEXCOORD4IVPROC glMultiTexCoord4iv = 0;
38 PFNGLMULTITEXCOORD4SPROC glMultiTexCoord4s = 0;
39 PFNGLMULTITEXCOORD4SVPROC glMultiTexCoord4sv = 0;
40
41 Extension::SupportLevel init_arb_multitexture()
42 {
43         if(is_version_at_least(1, 3))
44         {
45                 glActiveTexture = reinterpret_cast<PFNGLACTIVETEXTUREPROC>(get_proc_address("glActiveTexture"));
46                 glClientActiveTexture = reinterpret_cast<PFNGLCLIENTACTIVETEXTUREPROC>(get_proc_address("glClientActiveTexture"));
47                 glMultiTexCoord1d = reinterpret_cast<PFNGLMULTITEXCOORD1DPROC>(get_proc_address("glMultiTexCoord1d"));
48                 glMultiTexCoord1dv = reinterpret_cast<PFNGLMULTITEXCOORD1DVPROC>(get_proc_address("glMultiTexCoord1dv"));
49                 glMultiTexCoord1f = reinterpret_cast<PFNGLMULTITEXCOORD1FPROC>(get_proc_address("glMultiTexCoord1f"));
50                 glMultiTexCoord1fv = reinterpret_cast<PFNGLMULTITEXCOORD1FVPROC>(get_proc_address("glMultiTexCoord1fv"));
51                 glMultiTexCoord1i = reinterpret_cast<PFNGLMULTITEXCOORD1IPROC>(get_proc_address("glMultiTexCoord1i"));
52                 glMultiTexCoord1iv = reinterpret_cast<PFNGLMULTITEXCOORD1IVPROC>(get_proc_address("glMultiTexCoord1iv"));
53                 glMultiTexCoord1s = reinterpret_cast<PFNGLMULTITEXCOORD1SPROC>(get_proc_address("glMultiTexCoord1s"));
54                 glMultiTexCoord1sv = reinterpret_cast<PFNGLMULTITEXCOORD1SVPROC>(get_proc_address("glMultiTexCoord1sv"));
55                 glMultiTexCoord2d = reinterpret_cast<PFNGLMULTITEXCOORD2DPROC>(get_proc_address("glMultiTexCoord2d"));
56                 glMultiTexCoord2dv = reinterpret_cast<PFNGLMULTITEXCOORD2DVPROC>(get_proc_address("glMultiTexCoord2dv"));
57                 glMultiTexCoord2f = reinterpret_cast<PFNGLMULTITEXCOORD2FPROC>(get_proc_address("glMultiTexCoord2f"));
58                 glMultiTexCoord2fv = reinterpret_cast<PFNGLMULTITEXCOORD2FVPROC>(get_proc_address("glMultiTexCoord2fv"));
59                 glMultiTexCoord2i = reinterpret_cast<PFNGLMULTITEXCOORD2IPROC>(get_proc_address("glMultiTexCoord2i"));
60                 glMultiTexCoord2iv = reinterpret_cast<PFNGLMULTITEXCOORD2IVPROC>(get_proc_address("glMultiTexCoord2iv"));
61                 glMultiTexCoord2s = reinterpret_cast<PFNGLMULTITEXCOORD2SPROC>(get_proc_address("glMultiTexCoord2s"));
62                 glMultiTexCoord2sv = reinterpret_cast<PFNGLMULTITEXCOORD2SVPROC>(get_proc_address("glMultiTexCoord2sv"));
63                 glMultiTexCoord3d = reinterpret_cast<PFNGLMULTITEXCOORD3DPROC>(get_proc_address("glMultiTexCoord3d"));
64                 glMultiTexCoord3dv = reinterpret_cast<PFNGLMULTITEXCOORD3DVPROC>(get_proc_address("glMultiTexCoord3dv"));
65                 glMultiTexCoord3f = reinterpret_cast<PFNGLMULTITEXCOORD3FPROC>(get_proc_address("glMultiTexCoord3f"));
66                 glMultiTexCoord3fv = reinterpret_cast<PFNGLMULTITEXCOORD3FVPROC>(get_proc_address("glMultiTexCoord3fv"));
67                 glMultiTexCoord3i = reinterpret_cast<PFNGLMULTITEXCOORD3IPROC>(get_proc_address("glMultiTexCoord3i"));
68                 glMultiTexCoord3iv = reinterpret_cast<PFNGLMULTITEXCOORD3IVPROC>(get_proc_address("glMultiTexCoord3iv"));
69                 glMultiTexCoord3s = reinterpret_cast<PFNGLMULTITEXCOORD3SPROC>(get_proc_address("glMultiTexCoord3s"));
70                 glMultiTexCoord3sv = reinterpret_cast<PFNGLMULTITEXCOORD3SVPROC>(get_proc_address("glMultiTexCoord3sv"));
71                 glMultiTexCoord4d = reinterpret_cast<PFNGLMULTITEXCOORD4DPROC>(get_proc_address("glMultiTexCoord4d"));
72                 glMultiTexCoord4dv = reinterpret_cast<PFNGLMULTITEXCOORD4DVPROC>(get_proc_address("glMultiTexCoord4dv"));
73                 glMultiTexCoord4f = reinterpret_cast<PFNGLMULTITEXCOORD4FPROC>(get_proc_address("glMultiTexCoord4f"));
74                 glMultiTexCoord4fv = reinterpret_cast<PFNGLMULTITEXCOORD4FVPROC>(get_proc_address("glMultiTexCoord4fv"));
75                 glMultiTexCoord4i = reinterpret_cast<PFNGLMULTITEXCOORD4IPROC>(get_proc_address("glMultiTexCoord4i"));
76                 glMultiTexCoord4iv = reinterpret_cast<PFNGLMULTITEXCOORD4IVPROC>(get_proc_address("glMultiTexCoord4iv"));
77                 glMultiTexCoord4s = reinterpret_cast<PFNGLMULTITEXCOORD4SPROC>(get_proc_address("glMultiTexCoord4s"));
78                 glMultiTexCoord4sv = reinterpret_cast<PFNGLMULTITEXCOORD4SVPROC>(get_proc_address("glMultiTexCoord4sv"));
79                 return Extension::CORE;
80         }
81         if(is_supported("GL_ARB_multitexture"))
82         {
83                 glActiveTexture = reinterpret_cast<PFNGLACTIVETEXTUREPROC>(get_proc_address("glActiveTextureARB"));
84                 glClientActiveTexture = reinterpret_cast<PFNGLCLIENTACTIVETEXTUREPROC>(get_proc_address("glClientActiveTextureARB"));
85                 glMultiTexCoord1d = reinterpret_cast<PFNGLMULTITEXCOORD1DPROC>(get_proc_address("glMultiTexCoord1dARB"));
86                 glMultiTexCoord1dv = reinterpret_cast<PFNGLMULTITEXCOORD1DVPROC>(get_proc_address("glMultiTexCoord1dvARB"));
87                 glMultiTexCoord1f = reinterpret_cast<PFNGLMULTITEXCOORD1FPROC>(get_proc_address("glMultiTexCoord1fARB"));
88                 glMultiTexCoord1fv = reinterpret_cast<PFNGLMULTITEXCOORD1FVPROC>(get_proc_address("glMultiTexCoord1fvARB"));
89                 glMultiTexCoord1i = reinterpret_cast<PFNGLMULTITEXCOORD1IPROC>(get_proc_address("glMultiTexCoord1iARB"));
90                 glMultiTexCoord1iv = reinterpret_cast<PFNGLMULTITEXCOORD1IVPROC>(get_proc_address("glMultiTexCoord1ivARB"));
91                 glMultiTexCoord1s = reinterpret_cast<PFNGLMULTITEXCOORD1SPROC>(get_proc_address("glMultiTexCoord1sARB"));
92                 glMultiTexCoord1sv = reinterpret_cast<PFNGLMULTITEXCOORD1SVPROC>(get_proc_address("glMultiTexCoord1svARB"));
93                 glMultiTexCoord2d = reinterpret_cast<PFNGLMULTITEXCOORD2DPROC>(get_proc_address("glMultiTexCoord2dARB"));
94                 glMultiTexCoord2dv = reinterpret_cast<PFNGLMULTITEXCOORD2DVPROC>(get_proc_address("glMultiTexCoord2dvARB"));
95                 glMultiTexCoord2f = reinterpret_cast<PFNGLMULTITEXCOORD2FPROC>(get_proc_address("glMultiTexCoord2fARB"));
96                 glMultiTexCoord2fv = reinterpret_cast<PFNGLMULTITEXCOORD2FVPROC>(get_proc_address("glMultiTexCoord2fvARB"));
97                 glMultiTexCoord2i = reinterpret_cast<PFNGLMULTITEXCOORD2IPROC>(get_proc_address("glMultiTexCoord2iARB"));
98                 glMultiTexCoord2iv = reinterpret_cast<PFNGLMULTITEXCOORD2IVPROC>(get_proc_address("glMultiTexCoord2ivARB"));
99                 glMultiTexCoord2s = reinterpret_cast<PFNGLMULTITEXCOORD2SPROC>(get_proc_address("glMultiTexCoord2sARB"));
100                 glMultiTexCoord2sv = reinterpret_cast<PFNGLMULTITEXCOORD2SVPROC>(get_proc_address("glMultiTexCoord2svARB"));
101                 glMultiTexCoord3d = reinterpret_cast<PFNGLMULTITEXCOORD3DPROC>(get_proc_address("glMultiTexCoord3dARB"));
102                 glMultiTexCoord3dv = reinterpret_cast<PFNGLMULTITEXCOORD3DVPROC>(get_proc_address("glMultiTexCoord3dvARB"));
103                 glMultiTexCoord3f = reinterpret_cast<PFNGLMULTITEXCOORD3FPROC>(get_proc_address("glMultiTexCoord3fARB"));
104                 glMultiTexCoord3fv = reinterpret_cast<PFNGLMULTITEXCOORD3FVPROC>(get_proc_address("glMultiTexCoord3fvARB"));
105                 glMultiTexCoord3i = reinterpret_cast<PFNGLMULTITEXCOORD3IPROC>(get_proc_address("glMultiTexCoord3iARB"));
106                 glMultiTexCoord3iv = reinterpret_cast<PFNGLMULTITEXCOORD3IVPROC>(get_proc_address("glMultiTexCoord3ivARB"));
107                 glMultiTexCoord3s = reinterpret_cast<PFNGLMULTITEXCOORD3SPROC>(get_proc_address("glMultiTexCoord3sARB"));
108                 glMultiTexCoord3sv = reinterpret_cast<PFNGLMULTITEXCOORD3SVPROC>(get_proc_address("glMultiTexCoord3svARB"));
109                 glMultiTexCoord4d = reinterpret_cast<PFNGLMULTITEXCOORD4DPROC>(get_proc_address("glMultiTexCoord4dARB"));
110                 glMultiTexCoord4dv = reinterpret_cast<PFNGLMULTITEXCOORD4DVPROC>(get_proc_address("glMultiTexCoord4dvARB"));
111                 glMultiTexCoord4f = reinterpret_cast<PFNGLMULTITEXCOORD4FPROC>(get_proc_address("glMultiTexCoord4fARB"));
112                 glMultiTexCoord4fv = reinterpret_cast<PFNGLMULTITEXCOORD4FVPROC>(get_proc_address("glMultiTexCoord4fvARB"));
113                 glMultiTexCoord4i = reinterpret_cast<PFNGLMULTITEXCOORD4IPROC>(get_proc_address("glMultiTexCoord4iARB"));
114                 glMultiTexCoord4iv = reinterpret_cast<PFNGLMULTITEXCOORD4IVPROC>(get_proc_address("glMultiTexCoord4ivARB"));
115                 glMultiTexCoord4s = reinterpret_cast<PFNGLMULTITEXCOORD4SPROC>(get_proc_address("glMultiTexCoord4sARB"));
116                 glMultiTexCoord4sv = reinterpret_cast<PFNGLMULTITEXCOORD4SVPROC>(get_proc_address("glMultiTexCoord4svARB"));
117                 return Extension::EXTENSION;
118         }
119         return Extension::UNSUPPORTED;
120 }
121
122 Extension ARB_multitexture("GL_ARB_multitexture", init_arb_multitexture);
123
124 } // namespace GL
125 } // namespace Msp