#include "supertux/tile.hpp"
#include "supertux/world.hpp"
#include "util/gettext.hpp"
+#include "video/renderer.hpp"
#include "worldmap/tux.hpp"
#include "scripting/squirrel_util.hpp"
log_info << "Camera is at " << Sector::current()->camera->get_translation().x << "," << Sector::current()->camera->get_translation().y << std::endl;
}
-void set_gamma(float /*gamma*/) {
-#ifdef OLD_SDL1
- SDL_SetWindowGammaRamp(screen,gamma, gamma, gamma);
-#endif
+void set_gamma(float gamma)
+{
+ Renderer::instance()->set_gamma(gamma);
}
void quit()
}
}
+void
+GLRenderer::set_gamma(float gamma)
+{
+ Uint16 ramp[256];
+ SDL_CalculateGammaRamp(gamma, ramp);
+ SDL_SetWindowGammaRamp(window, ramp, ramp, ramp);
+}
+
/* EOF */
void resize(int w, int h);
void apply_config();
void apply_video_mode(const Size& size, bool fullscreen);
+ void set_gamma(float gamma);
};
#endif
virtual void flip() = 0;
virtual void resize(int w, int h) = 0;
virtual void apply_config() = 0;
+ virtual void set_gamma(float gamma) = 0;
static Renderer* instance() { assert(instance_); return instance_; }
}
+void
+SDLRenderer::set_gamma(float gamma)
+{
+ Uint16 ramp[256];
+ SDL_CalculateGammaRamp(gamma, ramp);
+ SDL_SetWindowGammaRamp(window, ramp, ramp, ramp);
+}
+
/* EOF */
void flip();
void resize(int w, int h);
void apply_config() {}
+ void set_gamma(float gamma);
SDL_Renderer* get_sdl_renderer() const { return renderer; };