From: Nils Forssén Date: Thu, 9 Nov 2023 13:11:34 +0000 (+0100) Subject: added background X-Git-Url: https://gitweb.forssennils.se/?a=commitdiff_plain;h=cf7578253239ce9f3be80c39cb87dfd8a5d73864;p=TDDC76_proj.git added background --- diff --git a/src/_main.cc b/src/_main.cc index 16058e1..bbb35e5 100644 --- a/src/_main.cc +++ b/src/_main.cc @@ -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 } }