From cf7578253239ce9f3be80c39cb87dfd8a5d73864 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Nils=20Forss=C3=A9n?= Date: Thu, 9 Nov 2023 14:11:34 +0100 Subject: [PATCH] added background --- src/_main.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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 } } -- 2.30.2