Rmoved commented-out code
This commit is contained in:
parent
3db2099635
commit
68fe26613a
@ -118,30 +118,6 @@ void Window::update() {
|
|||||||
void Window::show_image(const Image& image) {
|
void Window::show_image(const Image& image) {
|
||||||
// create texture from surface
|
// create texture from surface
|
||||||
_t.reset(SDL_CreateTextureFromSurface(_r.get(), image.surface()));
|
_t.reset(SDL_CreateTextureFromSurface(_r.get(), image.surface()));
|
||||||
/*
|
|
||||||
// get screen size, to scale down if image is too big
|
|
||||||
int w {image.width()};
|
|
||||||
int h {image.height()};
|
|
||||||
SDL_DisplayMode dm;
|
|
||||||
SDL_GetCurrentDisplayMode(0, &dm);
|
|
||||||
if (dm.w < w || dm.h < h) {
|
|
||||||
double screen_ratio {static_cast<double>(dm.w) / dm.h};
|
|
||||||
double image_ratio {static_cast<double>(w) / h};
|
|
||||||
const int safety {100}; // room for window and desktop adornments
|
|
||||||
if (screen_ratio > image_ratio) { // screen relatively less high than image
|
|
||||||
h = dm.h - safety;
|
|
||||||
w = static_cast<int>(round(image_ratio * h));
|
|
||||||
} else { // screen relatively less wide than image
|
|
||||||
w = dm.w - safety;
|
|
||||||
h = static_cast<int>(round(w / image_ratio));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
int ww, wh;
|
|
||||||
SDL_GetWindowSize(_w.get(), &ww, &wh);
|
|
||||||
if (ww != w || wh != h) {
|
|
||||||
set_size(w, h);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::add_event_handler(WindowEventHandler handler, SDL_WindowEventID type) {
|
void Window::add_event_handler(WindowEventHandler handler, SDL_WindowEventID type) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user