Created
June 2, 2015 18:11
-
-
Save santa4nt/a1d8aaf072a36658d960 to your computer and use it in GitHub Desktop.
Sample SFML app (Linux-based)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SFML/Graphics.hpp> | |
int main() | |
{ | |
sf::RenderWindow window(sf::VideoMode(200, 200), "Sample SFML"); | |
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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CXX = g++ -std=c++11 | |
LIBS = -lsfml-graphics -lsfml-window -lsfml-system | |
all: sample-sfml-app | |
%.o: %.cpp | |
$(CXX) -c $< -o $@ | |
%.o: %.hpp | |
$(CXX) -c $< -o $@ | |
sample-sfml-app: main.o | |
@echo "** Building the game" | |
$(CXX) -o sample-sfml-app main.o $(LIBS) | |
clean: | |
@echo "** Removing object files and executable..." | |
rm -f sample-sfml-app *.o | |
.PHONY: all clean |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment