I just started using SFML. I downloaded the SFML v1.6 and using it on my mac with mountain lion and xcode 4.4.1.
I manage to complete the starter tutorial that displays a yellow circle on the screen with a black background.
Everything runs fine except one thing. As soon as I launch the application, the mouse pointer changes to a rainbow wheel and I can no longer close my application using the application close button neither I can quit the application using the main apple menu. It seems like the window has become unresponsive.
I have to go back to my xcode project and stop the application. Anyone has any idea as to why it is happening?
should I try upgrading to SFML v2.0 and see if the problem still persists?
I am using the same code example that comes with the default xcode templates. The reason why I have added the C style linkage is because I am not using interface builder xib file and instead creating NSApplication object in the code itself. The startup code for NSApplication only accepts objective-c and C. I am sure the problem is somewhere else.
Lemme know if I can provide any more relevant information.
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
#include <SFML/Graphics.hpp>
////////////////////////////////////////////////////////////
/// Entry point of application
///
/// \return Application exit code
///
////////////////////////////////////////////////////////////
#ifdef __cplusplus
extern "C" {
#endif
int sfml_main(int argc, char *argv[])
{
// Create main window
sf::RenderWindow App(sf::VideoMode(1024, 768), "SFML Graphics");
App.ShowMouseCursor(true);
// Start game loop
while (App.IsOpened())
{
// Process events
sf::Event Event;
while (App.GetEvent(Event))
{
// Close window : exit
if (Event.Type == sf::Event::Closed)
App.Close();
}
// Clear screen
App.Clear();
// Draw apredefined shape
App.Draw(sf::Shape::Circle(200, 200, 100, sf::Color::Yellow, 10, sf::Color::Blue));
// Finally, display the rendered frame on screen
App.Display();
}
return EXIT_SUCCESS;
}
#ifdef __cplusplus
}
#endif