]> git.sesse.net Git - nageru/blobdiff - theme.cpp
Make sure our uploaded RGBA textures can deal with being asked for linear gamma.
[nageru] / theme.cpp
index b6a19acd2ea5b5eb28e36772fc560400d36d5d9c..f92143e954573b5c121c05c26585b5c484f113cd 100644 (file)
--- a/theme.cpp
+++ b/theme.cpp
@@ -630,7 +630,11 @@ LiveInputWrapper::LiveInputWrapper(Theme *theme, EffectChain *chain, bmusb::Pixe
 
        if (pixel_format == bmusb::PixelFormat_8BitRGBA) {
                for (unsigned i = 0; i < num_inputs; ++i) {
-                       rgba_inputs.push_back(new FlatInput(inout_format, FORMAT_RGBA_POSTMULTIPLIED_ALPHA, GL_UNSIGNED_BYTE, global_flags.width, global_flags.height));
+                       if (global_flags.can_disable_srgb_decoder) {
+                               rgba_inputs.push_back(new sRGBSwitchingFlatInput(inout_format, FORMAT_RGBA_POSTMULTIPLIED_ALPHA, GL_UNSIGNED_BYTE, global_flags.width, global_flags.height));
+                       } else {
+                               rgba_inputs.push_back(new NonsRGBCapableFlatInput(inout_format, FORMAT_RGBA_POSTMULTIPLIED_ALPHA, GL_UNSIGNED_BYTE, global_flags.width, global_flags.height));
+                       }
                        chain->add_input(rgba_inputs.back());
                }