+#include <msp/gl/extensions/arb_depth_buffer_float.h>
+#include <msp/gl/extensions/arb_depth_texture.h>
#include <msp/gl/extensions/arb_texture_float.h>
+#include <msp/gl/extensions/arb_texture_rg.h>
+#include <msp/gl/extensions/ext_texture_srgb.h>
+#include <msp/gl/extensions/oes_required_internalformat.h>
+#include <msp/gl/extensions/oes_texture_stencil8.h>
#include <msp/io/print.h>
#include <msp/strings/format.h>
#include "pixelformat.h"
else if(conv.get()=="DEPTH_COMPONENT32F")
fmt = DEPTH_COMPONENT32F;
else
- {
- if(conv.get()=="SRGB")
- fmt = SRGB8;
- else if(conv.get()=="SRGB_ALPHA")
- fmt = SRGB8_ALPHA8;
- else
- {
- PixelComponents comp;
- conv >> comp;
- fmt = make_pixelformat(comp, (comp==DEPTH_COMPONENT ? FLOAT : UNSIGNED_BYTE));
- }
- IO::print(IO::cerr, "Warning: deprecated conversion of '%s' to PixelFormat\n", conv.get());
- }
+ throw lexical_error(format("conversion of '%s' to PixelFormat", conv.get()));
}
PixelComponents components_from_graphics(Graphics::PixelFormat pf)
}
}
-PixelFormat pixelformat_from_image(const Graphics::Image &image)
+PixelFormat pixelformat_from_image(const Graphics::Image &image, bool srgb)
{
PixelComponents comp = components_from_graphics(image.get_format());
- return make_pixelformat(comp, UNSIGNED_BYTE);
+ return make_pixelformat(comp, UNSIGNED_BYTE, srgb);
}
PixelFormat make_pixelformat(PixelComponents comp, DataType type, bool srgb)
}
}
-GLenum get_gl_components(PixelComponents comp)
+unsigned get_gl_components(PixelComponents comp)
{
switch(comp)
{
}
}
-GLenum get_gl_pixelformat(PixelFormat pf)
+unsigned get_gl_pixelformat(PixelFormat pf)
{
switch(pf)
{