if(!size || size>4)
throw invalid_argument("get_sized_pixelformat");
- switch(pf)
- {
- case SRGB:
- case SRGB_ALPHA: break;
- case SRGB8: pf = SRGB; break;
- case SRGB8_ALPHA8: pf = SRGB_ALPHA; break;
- default: pf = get_base_pixelformat(pf);
- }
+ pf = get_unsized_pixelformat(pf);
switch(size)
{
}
}
+PixelFormat get_default_sized_pixelformat(PixelFormat pf)
+{
+ pf = get_unsized_pixelformat(pf);
+ unsigned size = 1;
+ if(pf==DEPTH_COMPONENT)
+ {
+ if(get_gl_api()==OPENGL_ES2 && !ARB_depth_buffer_float)
+ size = 2;
+ else
+ size = 4;
+ }
+ return get_sized_pixelformat(pf, size);
+}
+
PixelFormat get_srgb_pixelformat(PixelFormat pf)
{
switch(pf)