From cf227cc5ab410b307ac8b7666742985045a8ad01 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Thu, 6 Sep 2012 21:49:14 -0400 Subject: [PATCH] pass antialias level and compatibility context flags to Client --- src/client/Client.cc | 9 +++++++-- src/client/Client.h | 3 ++- src/client/main.cc | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/client/Client.cc b/src/client/Client.cc index 14cca93..ccb94a6 100755 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -10,7 +10,8 @@ using namespace std; -Client::Client(bool fullscreen) +Client::Client(bool fullscreen, bool compatibility_context, + unsigned int antialias_level) { sf::VideoMode mode = fullscreen ? sf::VideoMode::getDesktopMode() @@ -18,7 +19,11 @@ Client::Client(bool fullscreen) long style = fullscreen ? sf::Style::Fullscreen : sf::Style::Resize | sf::Style::Close; - m_window = new sf::Window(mode, "Treacherous Terrain", style); + const unsigned int opengl_major = compatibility_context ? 2 : 4; + const unsigned int opengl_minor = 0u; + sf::ContextSettings cs = sf::ContextSettings(0, 0, antialias_level, + opengl_major, opengl_minor); + m_window = new sf::Window(mode, "Treacherous Terrain", style, cs); GLenum err = glewInit(); if (err != GLEW_OK) { diff --git a/src/client/Client.h b/src/client/Client.h index bdb3b3d..f1c4c07 100755 --- a/src/client/Client.h +++ b/src/client/Client.h @@ -10,7 +10,8 @@ class Client { public: - Client(bool fullscreen); + Client(bool fullscreen, bool compatibility_context, + unsigned int antialias_level); void run(); protected: void initgl(); diff --git a/src/client/main.cc b/src/client/main.cc index 63ad9fc..aa4ff30 100755 --- a/src/client/main.cc +++ b/src/client/main.cc @@ -34,7 +34,7 @@ int main(int argc, char *argv[]) } } - Client client(fullscreen); + Client client(fullscreen, compatibility_context, antialias_level); client.run();