Turn off multisampling by default
This commit is contained in:
parent
c490d5307e
commit
835e0eab70
2 changed files with 14 additions and 1 deletions
|
|
@ -13,6 +13,7 @@ namespace psemek::app
|
||||||
: scene
|
: scene
|
||||||
{
|
{
|
||||||
app(std::string const & name);
|
app(std::string const & name);
|
||||||
|
app(std::string const & name, int multisampling);
|
||||||
~app() override;
|
~app() override;
|
||||||
|
|
||||||
virtual bool running() const;
|
virtual bool running() const;
|
||||||
|
|
|
||||||
|
|
@ -68,6 +68,10 @@ namespace psemek::app
|
||||||
};
|
};
|
||||||
|
|
||||||
app::app(std::string const & name)
|
app::app(std::string const & name)
|
||||||
|
: app(name, 0)
|
||||||
|
{}
|
||||||
|
|
||||||
|
app::app(std::string const & name, int multisampling)
|
||||||
: pimpl_{std::make_unique<struct impl>(this)}
|
: pimpl_{std::make_unique<struct impl>(this)}
|
||||||
{
|
{
|
||||||
impl().start_time = clock::now();
|
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_ALPHA_SIZE, 8);
|
||||||
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 24);
|
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);
|
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)
|
if (!impl().window)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue