initial build system
working to compile from cygwin in Windows with SFML-1.6
This commit is contained in:
1 parent
4c22f07923
commit
31d9ab8f10
4 files changed
+115
No files matched your search
@@ -0,0 +1,45 @@
|
||||
|
||||
#include <getopt.h>
|
||||
#include <SFML/Window.hpp>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
bool fullscreen = false;
|
||||
for (;;)
|
||||
{
|
||||
int c = getopt_long(argc, argv, "f", NULL, NULL);
|
||||
if (c == -1)
|
||||
break;
|
||||
switch (c)
|
||||
{
|
||||
case 'f':
|
||||
fullscreen = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
sf::VideoMode mode = fullscreen
|
||||
? 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())
|
||||
{
|
||||
sf::Event event;
|
||||
while (window.GetEvent(event))
|
||||
{
|
||||
if (event.Type == sf::Event::Closed)
|
||||
window.Close();
|
||||
|
||||
if ( (event.Type == sf::Event::KeyPressed)
|
||||
&& (event.Key.Code == sf::Key::Escape) )
|
||||
window.Close();
|
||||
}
|
||||
|
||||
window.Display();
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in new issue
Block a user