La till testexempelet till main och tillhörande filer
authorlukel495 <lukel495@tlvm-4-2-4.ad.liu.se>
Wed, 8 Nov 2023 13:46:30 +0000 (14:46 +0100)
committerlukel495 <lukel495@tlvm-4-2-4.ad.liu.se>
Wed, 8 Nov 2023 13:46:30 +0000 (14:46 +0100)
build/_main.o [new file with mode: 0644]
build/_test.o [new file with mode: 0644]
build/exe/game.out [new file with mode: 0755]
build/exe/test.out [new file with mode: 0755]
src/fighter.png [new file with mode: 0644]
src/font.ttf [new file with mode: 0644]
src/sfml_start.cc [new file with mode: 0644]

diff --git a/build/_main.o b/build/_main.o
new file mode 100644 (file)
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 (file)
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 (executable)
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 (executable)
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 (file)
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 (file)
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 (file)
index 0000000..b130bf0
--- /dev/null
@@ -0,0 +1,36 @@
+#include <SFML/Graphics.hpp> // 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
+    }
+}