window, opengl and pong examples now work on iOS
This commit is contained in:
parent
82c2f4c05e
commit
1272b704d6
7 changed files with 48 additions and 10 deletions
|
@ -8,6 +8,18 @@
|
|||
#include <ctime>
|
||||
#include <cstdlib>
|
||||
|
||||
#ifdef SFML_SYSTEM_IOS
|
||||
#include <SFML/Main.hpp>
|
||||
#endif
|
||||
|
||||
std::string resourcesDir()
|
||||
{
|
||||
#ifdef SFML_SYSTEM_IOS
|
||||
return "";
|
||||
#else
|
||||
return "resources/";
|
||||
#endif
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////
|
||||
/// Entry point of application
|
||||
|
@ -33,7 +45,7 @@ int main()
|
|||
|
||||
// Load the sounds used in the game
|
||||
sf::SoundBuffer ballSoundBuffer;
|
||||
if (!ballSoundBuffer.loadFromFile("resources/ball.wav"))
|
||||
if (!ballSoundBuffer.loadFromFile(resourcesDir() + "ball.wav"))
|
||||
return EXIT_FAILURE;
|
||||
sf::Sound ballSound(ballSoundBuffer);
|
||||
|
||||
|
@ -63,7 +75,7 @@ int main()
|
|||
|
||||
// Load the text font
|
||||
sf::Font font;
|
||||
if (!font.loadFromFile("resources/sansation.ttf"))
|
||||
if (!font.loadFromFile(resourcesDir() + "sansation.ttf"))
|
||||
return EXIT_FAILURE;
|
||||
|
||||
// Initialize the pause message
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue