From cd132533cd97aa2492d25c9c8e0086d08962b153 Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Wed, 16 Mar 2016 12:34:24 +0100 Subject: [PATCH] Workflow initial --- Makefile | 20 ++++++++++++++++++++ bin/.gitignore | 2 ++ obj/.gitignore | 2 ++ src/main.cpp | 8 ++++++++ src/sfmlTest.cpp | 24 ++++++++++++++++++++++++ 5 files changed, 56 insertions(+), 0 deletions(-) create mode 100644 Makefile create mode 100644 bin/.gitignore create mode 100644 obj/.gitignore create mode 100644 src/main.cpp create mode 100644 src/sfmlTest.cpp diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..09eaed7 --- /dev/null +++ b/Makefile @@ -0,0 +1,20 @@ +# Variables +## Compilation +CXX = g++ +#CXXFLAGS = -lsfml-graphics -lsfml-window -lsfml-system + +# Programmes possibles +main: bin/main + +# Éxecutables +bin/main: obj/main.o + $(CXX) $^ -o $@ $(CXXFLAGS) + +# Objets +obj/%.o: src/%.cpp + $(CXX) -c $< -o $@ + +# Meta +.PHONY: clean +clean: + rm -rf obj/*.o bin/* diff --git a/bin/.gitignore b/bin/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/bin/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/obj/.gitignore b/obj/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/obj/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..28c7232 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,8 @@ +/* Programme principal */ + +#include + +int main() { + std::cout << "Hello world!" << std::endl; + return 0; +} diff --git a/src/sfmlTest.cpp b/src/sfmlTest.cpp new file mode 100644 index 0000000..b5cc814 --- /dev/null +++ b/src/sfmlTest.cpp @@ -0,0 +1,24 @@ +#include + +int main() +{ + sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!"); + sf::CircleShape shape(100.f); + shape.setFillColor(sf::Color::Green); + + while (window.isOpen()) + { + sf::Event event; + while (window.pollEvent(event)) + { + if (event.type == sf::Event::Closed) + window.close(); + } + + window.clear(); + window.draw(shape); + window.display(); + } + + return 0; +} -- libgit2 0.21.2