mirror of
https://github.com/kuhyx/testsAndMisc.git
synced 2026-11-24 11:26:18 +01:00
feat: Adding smfl hello world code
This commit is contained in:
parent
326a2ad04c
commit
775e1c50f1
BIN
SFMLEngine/app
Executable file
BIN
SFMLEngine/app
Executable file
Binary file not shown.
24
SFMLEngine/hello.cpp
Normal file
24
SFMLEngine/hello.cpp
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#include <SFML/Graphics.hpp>
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
BIN
SFMLEngine/hello.o
Normal file
BIN
SFMLEngine/hello.o
Normal file
Binary file not shown.
6
SFMLEngine/makefile
Normal file
6
SFMLEngine/makefile
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
compile:./hello.cpp
|
||||||
|
g++ -c ./hello.cpp
|
||||||
|
g++ hello.o -o app -lsfml-graphics -lsfml-window -lsfml-system
|
||||||
|
|
||||||
|
run:
|
||||||
|
./app
|
||||||
Loading…
Reference in New Issue
Block a user