Merge pull request #604 from XiadaOku/resolution-fix

Init window with resolution size
This commit is contained in:
Yury Zhuravlev
2022-08-13 12:05:59 +09:00
committed by GitHub

View File

@@ -174,7 +174,7 @@ int XGR_Screen::init(int flags_in)
ErrH.Abort(SDL_GetError(),XERR_USER, 0);
}
} else {
if (SDL_CreateWindowAndRenderer(this->hdWidth, this->hdHeight, SDL_WINDOW_RESIZABLE | SDL_WINDOW_MAXIMIZED, &sdlWindow, &sdlRenderer) < 0) {
if (SDL_CreateWindowAndRenderer(this->hdWidth, this->hdHeight, SDL_WINDOW_RESIZABLE, &sdlWindow, &sdlRenderer) < 0) {
std::cout<<"ERROR2"<<std::endl;
ErrH.Abort(SDL_GetError(),XERR_USER, 0);
}
@@ -294,6 +294,7 @@ void XGR_Screen::set_resolution(int width, int height){
}
destroy_surfaces();
SDL_SetWindowSize(sdlWindow, width, height);
create_surfaces(width, height);
}