From: lukel495 Date: Wed, 8 Nov 2023 13:46:30 +0000 (+0100) Subject: La till testexempelet till main och tillhörande filer X-Git-Url: https://gitweb.forssennils.se/?a=commitdiff_plain;h=b9f40bea76c706c16b8fecd78977f700da079bb0;p=TDDC76_proj.git La till testexempelet till main och tillhörande filer --- diff --git a/build/_main.o b/build/_main.o new file mode 100644 index 0000000..5557490 Binary files /dev/null and b/build/_main.o differ diff --git a/build/_test.o b/build/_test.o new file mode 100644 index 0000000..bbeaa95 Binary files /dev/null and b/build/_test.o differ diff --git a/build/exe/game.out b/build/exe/game.out new file mode 100755 index 0000000..97b21ed Binary files /dev/null and b/build/exe/game.out differ diff --git a/build/exe/test.out b/build/exe/test.out new file mode 100755 index 0000000..94b0db0 Binary files /dev/null and b/build/exe/test.out differ diff --git a/src/fighter.png b/src/fighter.png new file mode 100644 index 0000000..6a36a83 Binary files /dev/null and b/src/fighter.png differ diff --git a/src/font.ttf b/src/font.ttf new file mode 100644 index 0000000..f578602 Binary files /dev/null and b/src/font.ttf differ diff --git a/src/sfml_start.cc b/src/sfml_start.cc new file mode 100644 index 0000000..b130bf0 --- /dev/null +++ b/src/sfml_start.cc @@ -0,0 +1,36 @@ +#include // includes most things in SFML + +using namespace sf; + +int const width { 640 }; +int const height { 480 }; + +int main () +{ + RenderWindow window { + VideoMode { width, height }, + "SFML DEMO" + }; + + // loopa sÃ¥länge fönstret finns + while ( window.isOpen () ) + { + /* hantera events */ + Event event; + // hämta ett event i taget + while ( window.pollEvent (event) ) + { + if ( event.type == Event::Closed ) + { + window.close (); + } + } + + /* hantera logiken */ + + /* rita ut */ + window.clear (); // rensa skärmen + + window.display (); // visa ändringarna + } +}