+ throw invalid_argument("get_sized_pixelformat");
+ case 4:
+ switch(pf)
+ {
+ case RED: return R32F;
+ case RG: return RG32F;
+ case RGB: return RGB32F;
+ case RGBA: return RGBA32F;
+ case DEPTH_COMPONENT: return ARB_depth_buffer_float ? DEPTH_COMPONENT32F : DEPTH_COMPONENT32;
+ default: throw invalid_argument("get_sized_pixelformat");
+ }
+ default:
+ throw invalid_argument("get_sized_pixelformat");
+ }
+}
+
+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;