]> git.tdb.fi Git - libs/gl.git/blobdiff - source/pixelformat.cpp
Check the relevant extensions when using pixel formats
[libs/gl.git] / source / pixelformat.cpp
index 60fdc111e427c5e6ba563bfe0b849b1f4976537f..4b3dade14e4a9eef0b1052d4764c8e0c4c2b8a51 100644 (file)
@@ -1,4 +1,6 @@
 #include <msp/strings/format.h>
+#include "arb_texture_float.h"
+#include "ext_bgra.h"
 #include "pixelformat.h"
 
 using namespace std;
@@ -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