]> git.tdb.fi Git - libs/gl.git/blob - source/ext_framebuffer_multisample.cpp
Complete rewrite of extension handling
[libs/gl.git] / source / ext_framebuffer_multisample.cpp
1 #include "ext_framebuffer_multisample.h"
2
3 namespace Msp {
4 namespace GL {
5
6 PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC glRenderbufferStorageMultisample = 0;
7
8 Extension::SupportLevel init_ext_framebuffer_multisample()
9 {
10         if(is_version_at_least(3, 0) || is_supported("GL_ARB_framebuffer_object"))
11         {
12                 glRenderbufferStorageMultisample = reinterpret_cast<PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC>(get_proc_address("glRenderbufferStorageMultisample"));
13                 return Extension::CORE;
14         }
15         if(is_supported("GL_EXT_framebuffer_multisample"))
16         {
17                 glRenderbufferStorageMultisample = reinterpret_cast<PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC>(get_proc_address("glRenderbufferStorageMultisampleEXT"));
18                 return Extension::EXTENSION;
19         }
20         return Extension::UNSUPPORTED;
21 }
22
23 Extension EXT_framebuffer_multisample("GL_EXT_framebuffer_multisample", init_ext_framebuffer_multisample);
24
25 } // namespace GL
26 } // namespace Msp