Commit cd132533cd97aa2492d25c9c8e0086d08962b153
0 parents
Workflow initial
Showing
5 changed files
with
56 additions
and
0 deletions
Show diff stats
1 | +++ a/Makefile | ||
@@ -0,0 +1,20 @@ | @@ -0,0 +1,20 @@ | ||
1 | +# Variables | ||
2 | +## Compilation | ||
3 | +CXX = g++ | ||
4 | +#CXXFLAGS = -lsfml-graphics -lsfml-window -lsfml-system | ||
5 | + | ||
6 | +# Programmes possibles | ||
7 | +main: bin/main | ||
8 | + | ||
9 | +# Éxecutables | ||
10 | +bin/main: obj/main.o | ||
11 | + $(CXX) $^ -o $@ $(CXXFLAGS) | ||
12 | + | ||
13 | +# Objets | ||
14 | +obj/%.o: src/%.cpp | ||
15 | + $(CXX) -c $< -o $@ | ||
16 | + | ||
17 | +# Meta | ||
18 | +.PHONY: clean | ||
19 | +clean: | ||
20 | + rm -rf obj/*.o bin/* |
1 | +++ a/src/sfmlTest.cpp | ||
@@ -0,0 +1,24 @@ | @@ -0,0 +1,24 @@ | ||
1 | +#include <SFML/Graphics.hpp> | ||
2 | + | ||
3 | +int main() | ||
4 | +{ | ||
5 | + sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!"); | ||
6 | + sf::CircleShape shape(100.f); | ||
7 | + shape.setFillColor(sf::Color::Green); | ||
8 | + | ||
9 | + while (window.isOpen()) | ||
10 | + { | ||
11 | + sf::Event event; | ||
12 | + while (window.pollEvent(event)) | ||
13 | + { | ||
14 | + if (event.type == sf::Event::Closed) | ||
15 | + window.close(); | ||
16 | + } | ||
17 | + | ||
18 | + window.clear(); | ||
19 | + window.draw(shape); | ||
20 | + window.display(); | ||
21 | + } | ||
22 | + | ||
23 | + return 0; | ||
24 | +} |