Skip to content

Commit

Permalink
Fix errors and warnings in templates
Browse files Browse the repository at this point in the history
  • Loading branch information
vittorioromeo committed Apr 24, 2023
1 parent 5480bf8 commit 2af0ba6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions tools/xcode/templates/SFML/SFML App.xctemplate/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,30 @@
// Here is a small helper for you! Have a look.
#include "ResourcePath.hpp"

int main(int, char const**)
int main()
{
// Create the main window
sf::RenderWindow window(sf::VideoMode({800, 600}), "SFML window");

// Set the Icon
sf::Image icon;
if (!icon.loadFromFile(resourcePath() + "icon.png"))
if (!icon.loadFromFile(resourcePath() / "icon.png"))
{
return EXIT_FAILURE;
}
window.setIcon(icon.getSize().x, icon.getSize().y, icon.getPixelsPtr());
window.setIcon(icon);

// Load a sprite to display
sf::Texture texture;
if (!texture.loadFromFile(resourcePath() + "background.jpg"))
if (!texture.loadFromFile(resourcePath() / "background.jpg"))
{
return EXIT_FAILURE;
}
sf::Sprite sprite(texture);

// Create a graphical text to display
sf::Font font;
if (!font.loadFromFile(resourcePath() + "tuffy.ttf"))
if (!font.loadFromFile(resourcePath() / "tuffy.ttf"))
{
return EXIT_FAILURE;
}
Expand All @@ -52,7 +52,7 @@ int main(int, char const**)

// Load a music to play
sf::Music music;
if (!music.openFromFile(resourcePath() + "doodle_pop.ogg"))
if (!music.openFromFile(resourcePath() / "doodle_pop.ogg"))
{
return EXIT_FAILURE;
}
Expand Down
4 changes: 2 additions & 2 deletions tools/xcode/templates/SFML/SFML CLT.xctemplate/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <SFML/Audio.hpp>
#include <SFML/Graphics.hpp>

int main(int argc, char const** argv)
int main()
{
// Create the main window
sf::RenderWindow window(sf::VideoMode({800, 600}), "SFML window");
Expand All @@ -29,7 +29,7 @@ int main(int argc, char const** argv)
{
return EXIT_FAILURE;
}
window.setIcon(icon.getSize().x, icon.getSize().y, icon.getPixelsPtr());
window.setIcon(icon);

// Load a sprite to display
sf::Texture texture;
Expand Down

0 comments on commit 2af0ba6

Please sign in to comment.