}
Vector
-GLRenderer::to_logical(int physical_x, int physical_y, bool foobar)
+GLRenderer::to_logical(int physical_x, int physical_y)
{
return Vector(physical_x * float(SCREEN_WIDTH) / PHYSICAL_SCREEN_WIDTH,
physical_y * float(SCREEN_HEIGHT) / PHYSICAL_SCREEN_HEIGHT);
void resize(int w, int h);
void apply_config();
void apply_video_mode(const Size& size, bool fullscreen);
- Vector to_logical(int physical_x, int physical_y, bool foobar);
+ Vector to_logical(int physical_x, int physical_y);
void set_gamma(float gamma);
SDL_Window* get_window() const { return window; }
};
virtual void flip() = 0;
virtual void resize(int w, int h) = 0;
virtual void apply_config() = 0;
- virtual Vector to_logical(int physical_x, int physical_y, bool foobar = false) = 0;
+ virtual Vector to_logical(int physical_x, int physical_y) = 0;
virtual void set_gamma(float gamma) = 0;
virtual SDL_Window* get_window() const = 0;
}
Vector
-SDLRenderer::to_logical(int physical_x, int physical_y, bool foobar)
+SDLRenderer::to_logical(int physical_x, int physical_y)
{
- if (foobar)
- {
- // SDL translates coordinates automatically, except for SDL_GetMouseState(), thus foobar
- return Vector(physical_x * float(SCREEN_WIDTH) / (PHYSICAL_SCREEN_WIDTH),
- physical_y * float(SCREEN_HEIGHT) / (PHYSICAL_SCREEN_HEIGHT));
- }
- else
- {
- // SDL is doing the translation internally, so we have nothing to do
- return Vector(physical_x, physical_y);
- }
+ // SDL is doing the translation internally, so we have nothing to do
+ return Vector(physical_x, physical_y);
}
void
void flip();
void resize(int w, int h);
void apply_config();
- Vector to_logical(int physical_x, int physical_y, bool foobar);
+ Vector to_logical(int physical_x, int physical_y);
void set_gamma(float gamma);
SDL_Window* get_window() const { return window; }