update template to use SFML-2.0-rc

This commit is contained in:
Josh Holtrop 2012-08-13 23:27:33 -04:00
parent 31d9ab8f10
commit eae0dc9e34
2 changed files with 13 additions and 14 deletions

View File

@ -9,16 +9,15 @@ server_name = client_name + '-server'
platform = 'windows' if os.path.exists('/bin/cygwin1.dll') else 'unix' platform = 'windows' if os.path.exists('/bin/cygwin1.dll') else 'unix'
# common environment settings # common environment settings
#SFML_VERSION = '2.0-rc' SFML_VERSION = '2.0-rc'
SFML_VERSION = '1.6'
BIN_DIR = 'bin' BIN_DIR = 'bin'
CXX = 'g++' CXX = 'g++'
CPPFLAGS = [] CPPFLAGS = ['-DSFML_STATIC']
CXXFLAGS = ['-Wall', '-O2'] CXXFLAGS = ['-Wall', '-O2']
LINKFLAGS = [] LINKFLAGS = []
LIBPATH = [] LIBPATH = []
LIBS_client = ['sfml-network', 'sfml-system', 'sfml-window'] LIBS_client = ['sfml-network-s', 'sfml-window-s', 'sfml-system-s']
LIBS_server = ['sfml-network'] LIBS_server = ['sfml-network-s']
libs_to_copy = [] libs_to_copy = []
if platform == 'windows': if platform == 'windows':

View File

@ -18,27 +18,27 @@ int main(int argc, char *argv[])
} }
} }
sf::VideoMode mode = fullscreen sf::VideoMode mode = fullscreen
? sf::VideoMode::GetDesktopMode() ? sf::VideoMode::getDesktopMode()
: sf::VideoMode(800, 600, 32); : sf::VideoMode(800, 600, 32);
long style = fullscreen long style = fullscreen
? sf::Style::Fullscreen ? sf::Style::Fullscreen
: sf::Style::Resize | sf::Style::Close; : sf::Style::Resize | sf::Style::Close;
sf::Window window(mode, "Treacherous Terrain", style); sf::Window window(mode, "Treacherous Terrain", style);
while (window.IsOpened()) while (window.isOpen())
{ {
sf::Event event; sf::Event event;
while (window.GetEvent(event)) while (window.pollEvent(event))
{ {
if (event.Type == sf::Event::Closed) if (event.type == sf::Event::Closed)
window.Close(); window.close();
if ( (event.Type == sf::Event::KeyPressed) if ( (event.type == sf::Event::KeyPressed)
&& (event.Key.Code == sf::Key::Escape) ) && (event.key.code == sf::Keyboard::Escape) )
window.Close(); window.close();
} }
window.Display(); window.display();
} }
return 0; return 0;