X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=source%2Fpixelformat.cpp;h=3fdf6942c63cc606c04babdf54316330878ec1f9;hp=99f15307d1304bf41c36c80aa7af825fd41a7171;hb=49323eea600fb989d4181ccfd437ee12722ae733;hpb=0221e39a685c4f3122a0fae032a7888b5ce40579 diff --git a/source/pixelformat.cpp b/source/pixelformat.cpp index 99f15307..3fdf6942 100644 --- a/source/pixelformat.cpp +++ b/source/pixelformat.cpp @@ -103,6 +103,27 @@ PixelFormat get_base_pixelformat(PixelFormat pf) } } +PixelFormat get_sized_pixelformat(PixelFormat pf) +{ + switch(pf) + { + case RGB: return RGB8; + case RGBA: return RGBA8; + case SRGB: return SRGB8; + case SRGB_ALPHA: return SRGB8_ALPHA8; + case LUMINANCE: return LUMINANCE8; + case SLUMINANCE: return SLUMINANCE8; + case LUMINANCE_ALPHA: return LUMINANCE8_ALPHA8; + case SLUMINANCE_ALPHA: return SLUMINANCE8_ALPHA8; + case DEPTH_COMPONENT: + if(get_gl_api()==OPENGL_ES2) + return DEPTH_COMPONENT16; + else + return DEPTH_COMPONENT32; + default: return pf; + } +} + PixelFormat get_srgb_pixelformat(PixelFormat pf) { switch(pf)