]> git.tdb.fi Git - libs/gl.git/blobdiff - source/core/pixelformat.cpp
Add an abstraction for queries
[libs/gl.git] / source / core / pixelformat.cpp
index 270f27f7dc2e4fe9e608471c37ebf015830a3f9a..11eb40812ea631ff2421b88d55e39812d9ea09d5 100644 (file)
@@ -5,7 +5,6 @@
 #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"
 
@@ -106,10 +105,10 @@ 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)
@@ -169,7 +168,7 @@ void require_pixelformat(PixelFormat pf)
        }
 }
 
-GLenum get_gl_components(PixelComponents comp)
+unsigned get_gl_components(PixelComponents comp)
 {
        switch(comp)
        {
@@ -183,7 +182,7 @@ GLenum get_gl_components(PixelComponents comp)
        }
 }
 
-GLenum get_gl_pixelformat(PixelFormat pf)
+unsigned get_gl_pixelformat(PixelFormat pf)
 {
        switch(pf)
        {