]> git.tdb.fi Git - libs/gl.git/blobdiff - source/pixelformat.cpp
Final touches of OS X support
[libs/gl.git] / source / pixelformat.cpp
index 60fdc111e427c5e6ba563bfe0b849b1f4976537f..836012f9d0c7cfd294e542bcbb0c10d3cc932c69 100644 (file)
@@ -1,3 +1,5 @@
+#include <msp/gl/extensions/arb_texture_float.h>
+#include <msp/gl/extensions/ext_bgra.h>
 #include <msp/strings/format.h>
 #include "pixelformat.h"
 
@@ -73,5 +75,28 @@ PixelFormat get_base_pixelformat(PixelFormat pf)
        }
 }
 
+void require_pixelformat(PixelFormat pf)
+{
+       switch(pf)
+       {
+       case RGB16F:
+       case RGB32F:
+       case RGBA16F:
+       case RGBA32F:
+       case LUMINANCE16F:
+       case LUMINANCE32F:
+       case LUMINANCE_ALPHA16F:
+       case LUMINANCE_ALPHA32F:
+               { static Require _req(ARB_texture_float); }
+               break;
+       case BGR:
+       case BGRA:
+               { static Require _req(EXT_bgra); }
+               break;
+       default:
+               break;
+       }
+}
+
 } // namespace GL
 } // namespace Msp