For some reason, I can't get the sample code to run correctly. Xcode stops with a bad access error on window.clear().
I've double-checked that I have the command line tools installed and corresponding SFML files are in the correct places.
Here is the code that I am trying to run:
#include <SFML/Graphics.hpp>
int main(int, char const**)
{
// Create the main window
sf::RenderWindow window(sf::VideoMode(800, 600), "SFML window");
// Start the game loop
while (window.isOpen())
{
// Process events
sf::Event event;
while (window.pollEvent(event))
{
// Close window: exit
if (event.type == sf::Event::Closed) {
window.close();
}
// Escape pressed: exit
if (event.type == sf::Event::KeyPressed && event.key.code == sf::Keyboard::Escape) {
window.close();
}
}
// Clear screen
window.clear();
// Update the window
window.display();
}
return EXIT_SUCCESS;
}