]> git.tdb.fi Git - libs/gl.git/blobdiff - source/pixelformat.cpp
Update deprecated things
[libs/gl.git] / source / pixelformat.cpp
index 6655c6b22c3b3205e06be0bbe338e643209d2da9..0b13f3ccefa7fe53cf2e5868b157a7d0c0e5588b 100644 (file)
@@ -173,6 +173,20 @@ PixelFormat get_sized_pixelformat(PixelFormat pf, unsigned 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)