#include <SFML/Graphics.hpp> // includes most things in SFML
-using namespace sf;
+const unsigned int S_WIDTH {1280};
+const unsigned int S_HEIGHT {720};
-static const int s_width {1280};
-static const int s_height {720};
-
-static const int scale_koeff {s_width / 1920};
+const double S_SCALE_KOEFF {s_width / 1920.0};
int main ()
{
- RenderWindow window{
- VideoMode{s_width, s_height},
+ sf::RenderWindow window{
+ sf::VideoMode{S_WIDTH, S_HEIGHT},
"DespYrat"
};
- Texture t;
+
+ sf::Texture t;
t.loadFromFile("assets/hel_bakgrund.png");
- Sprite s(t);
- s.setScale(0.6666667, 0.6666667);
+ sf::Sprite s(t);
+
+ s.setScale(S_SCALE_KOEFF, S_SCALE_KOEFF);
while (window.isOpen())
{
/* hantera events */
- Event event;
+ sf::Event event;
// hämta ett event i taget
while (window.pollEvent(event))
{
- if (event.type == Event::Closed)
+ if (event.type == sf::Event::Closed)
{
window.close();
}