-#include "extension.h"
#include "ext_framebuffer_blit.h"
namespace Msp {
namespace GL {
-PFNGLBLITFRAMEBUFFEREXTPROC glBlitFramebufferEXT=0;
+PFNGLBLITFRAMEBUFFERPROC glBlitFramebuffer = 0;
-void init_ext_framebuffer_blit()
+Extension::SupportLevel init_ext_framebuffer_blit()
{
- glBlitFramebufferEXT=reinterpret_cast<PFNGLBLITFRAMEBUFFEREXTPROC>(get_proc_address("glBlitFramebufferEXT"));
+ if(is_version_at_least(3, 0) || is_supported("GL_ARB_framebuffer_object"))
+ {
+ glBlitFramebuffer = reinterpret_cast<PFNGLBLITFRAMEBUFFERPROC>(get_proc_address("glBlitFramebuffer"));
+ return Extension::CORE;
+ }
+ if(is_supported("GL_EXT_framebuffer_blit"))
+ {
+ glBlitFramebuffer = reinterpret_cast<PFNGLBLITFRAMEBUFFERPROC>(get_proc_address("glBlitFramebufferEXT"));
+ return Extension::EXTENSION;
+ }
+ return Extension::UNSUPPORTED;
}
+Extension EXT_framebuffer_blit("GL_EXT_framebuffer_blit", init_ext_framebuffer_blit);
+
} // namespace GL
} // namespace Msp