]> git.tdb.fi Git - libs/gl.git/blob - source/ext_texture3d.cpp
Add a method of getting the model matrix of a Renderable
[libs/gl.git] / source / ext_texture3d.cpp
1 #include "ext_texture3d.h"
2
3 namespace Msp {
4 namespace GL {
5
6 PFNGLTEXIMAGE3DPROC glTexImage3D = 0;
7 PFNGLTEXSUBIMAGE3DPROC glTexSubImage3D = 0;
8
9 Extension::SupportLevel init_ext_texture3d()
10 {
11         if(is_version_at_least(1, 2))
12         {
13                 glTexImage3D = reinterpret_cast<PFNGLTEXIMAGE3DPROC>(get_proc_address("glTexImage3D"));
14                 glTexSubImage3D = reinterpret_cast<PFNGLTEXSUBIMAGE3DPROC>(get_proc_address("glTexSubImage3D"));
15                 return Extension::CORE;
16         }
17         if(is_supported("GL_EXT_texture3D"))
18         {
19                 glTexImage3D = reinterpret_cast<PFNGLTEXIMAGE3DPROC>(get_proc_address("glTexImage3DEXT"));
20                 glTexSubImage3D = reinterpret_cast<PFNGLTEXSUBIMAGE3DPROC>(get_proc_address("glTexSubImage3DEXT"));
21                 return Extension::EXTENSION;
22         }
23         return Extension::UNSUPPORTED;
24 }
25
26 Extension EXT_texture3D("GL_EXT_texture3D", init_ext_texture3d);
27
28 } // namespace GL
29 } // namespace Msp