added background
authorNils Forssén <nilfo359@student.liu.se>
Thu, 9 Nov 2023 13:11:34 +0000 (14:11 +0100)
committerNils Forssén <nilfo359@student.liu.se>
Thu, 9 Nov 2023 13:11:34 +0000 (14:11 +0100)
src/_main.cc

index 16058e1e9d05ac9b7db16fcd13945d0f5a36fdac..bbb35e506bdf47b3fde8fea6ebc7a90032fb132e 100644 (file)
@@ -13,7 +13,11 @@ int main ()
     RenderWindow window{
         VideoMode{1920, 1080},
         "DespYrat"
-    };  
+    };
+
+    Texture t;
+    t.loadFromFile("assets/hel_bakgrund.png");
+    Sprite s(t);
     
     while (window.isOpen())
     {
@@ -27,5 +31,11 @@ int main ()
                 window.close();
             }
         }
+
+
+                /* rita ut */
+        window.clear(); // rensa skärmen
+        window.draw(s);
+        window.display(); // visa ändringarna
     }
 }