diff --git a/libs/app/include/psemek/app/app.hpp b/libs/app/include/psemek/app/app.hpp index e2211ea3..ccfc4cdb 100644 --- a/libs/app/include/psemek/app/app.hpp +++ b/libs/app/include/psemek/app/app.hpp @@ -13,6 +13,7 @@ namespace psemek::app : scene { app(std::string const & name); + app(std::string const & name, int multisampling); ~app() override; virtual bool running() const; diff --git a/libs/app/source/app.cpp b/libs/app/source/app.cpp index 2963ad9e..70fd752c 100644 --- a/libs/app/source/app.cpp +++ b/libs/app/source/app.cpp @@ -68,6 +68,10 @@ namespace psemek::app }; app::app(std::string const & name) + : app(name, 0) + {} + + app::app(std::string const & name, int multisampling) : pimpl_{std::make_unique(this)} { impl().start_time = clock::now(); @@ -81,7 +85,15 @@ namespace psemek::app SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 8); SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24); - SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 0); + if (multisampling == 0) + { + SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 0); + } + else + { + SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, 1); + SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, multisampling); + } impl().window = SDL_CreateWindow(name.data(), SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 800, 600, SDL_WINDOW_RESIZABLE | SDL_WINDOW_OPENGL | SDL_WINDOW_MAXIMIZED); if (!impl().window)