Initial commit
This commit is contained in:
commit
dbb69dd80e
3
.gitignore
vendored
Normal file
3
.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
# ignore binaries
|
||||
obj
|
||||
main
|
26
main.cpp
Normal file
26
main.cpp
Normal file
@ -0,0 +1,26 @@
|
||||
#include <SFML/Graphics.hpp>
|
||||
#include <stdio.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
sf::Uint32 style = sf::Style::Titlebar;
|
||||
sf::RenderWindow window(sf::VideoMode(1600, 900), "SFML works!", style);
|
||||
sf::CircleShape shape(450.f);
|
||||
shape.setFillColor(sf::Color::Green);
|
||||
|
||||
printf("Hello meme!\n");
|
||||
|
||||
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;
|
||||
}
|
28
makefile
Normal file
28
makefile
Normal file
@ -0,0 +1,28 @@
|
||||
TARGET = main
|
||||
|
||||
CC = g++
|
||||
|
||||
OBJD = obj
|
||||
SRCS := $(wildcard *.cpp)
|
||||
OBJS := $(SRCS:%.cpp=$(OBJD)/%.o)
|
||||
|
||||
CCFLAGS = -Wall
|
||||
LDFLAGS = -lsfml-graphics -lsfml-window -lsfml-system
|
||||
|
||||
.PHONY: all run clean
|
||||
|
||||
all: $(TARGET) $(OBJD)
|
||||
|
||||
$(TARGET): $(OBJS)
|
||||
$(CC) $^ -o $(TARGET) $(LDFLAGS) $(CCFLAGS)
|
||||
|
||||
$(OBJS): $(OBJD)/%.o: %.cpp
|
||||
mkdir -p $(@D)
|
||||
$(CC) -c $? -o $@ $(CCFLAGS)
|
||||
|
||||
clean:
|
||||
rm -r $(TARGET) $(OBJD)
|
||||
|
||||
run:
|
||||
./$(TARGET)
|
||||
|
Loading…
Reference in New Issue
Block a user