From eae0dc9e34f97718dd3e7ec2870b7ccd7e37bb2d Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Mon, 13 Aug 2012 23:27:33 -0400 Subject: [PATCH] update template to use SFML-2.0-rc --- SConstruct | 9 ++++----- src/client/Client.cc | 18 +++++++++--------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/SConstruct b/SConstruct index 04aeede..80644ce 100644 --- a/SConstruct +++ b/SConstruct @@ -9,16 +9,15 @@ server_name = client_name + '-server' platform = 'windows' if os.path.exists('/bin/cygwin1.dll') else 'unix' # common environment settings -#SFML_VERSION = '2.0-rc' -SFML_VERSION = '1.6' +SFML_VERSION = '2.0-rc' BIN_DIR = 'bin' CXX = 'g++' -CPPFLAGS = [] +CPPFLAGS = ['-DSFML_STATIC'] CXXFLAGS = ['-Wall', '-O2'] LINKFLAGS = [] LIBPATH = [] -LIBS_client = ['sfml-network', 'sfml-system', 'sfml-window'] -LIBS_server = ['sfml-network'] +LIBS_client = ['sfml-network-s', 'sfml-window-s', 'sfml-system-s'] +LIBS_server = ['sfml-network-s'] libs_to_copy = [] if platform == 'windows': diff --git a/src/client/Client.cc b/src/client/Client.cc index 4ae2035..6143e91 100644 --- a/src/client/Client.cc +++ b/src/client/Client.cc @@ -18,27 +18,27 @@ int main(int argc, char *argv[]) } } sf::VideoMode mode = fullscreen - ? sf::VideoMode::GetDesktopMode() + ? sf::VideoMode::getDesktopMode() : sf::VideoMode(800, 600, 32); long style = fullscreen ? sf::Style::Fullscreen : sf::Style::Resize | sf::Style::Close; sf::Window window(mode, "Treacherous Terrain", style); - while (window.IsOpened()) + while (window.isOpen()) { sf::Event event; - while (window.GetEvent(event)) + while (window.pollEvent(event)) { - if (event.Type == sf::Event::Closed) - window.Close(); + if (event.type == sf::Event::Closed) + window.close(); - if ( (event.Type == sf::Event::KeyPressed) - && (event.Key.Code == sf::Key::Escape) ) - window.Close(); + if ( (event.type == sf::Event::KeyPressed) + && (event.key.code == sf::Keyboard::Escape) ) + window.close(); } - window.Display(); + window.display(); } return 0;