Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: ci.yml
on:
push:
branches: ['**']
pull_request:
jobs:
build:
runs-on: ubuntu-26.04
permissions:
contents: read
checks: write

steps:
- name: Checkout
uses: actions/checkout@v7

- name: Install gf
run : |
sudo apt-get update -y
sudo apt-get install libsdl2-dev libstb-dev libboost-dev libfreetype6-dev zlib1g-dev libpugixml-dev cmake -y
git clone https://github.com/GamedevFramework/gf.git
cd gf
git submodule update --init
mkdir build
cd build
cmake ../ -DGF_BUILD_GAMES=ON -DGF_BUILD_TOOLS=ON -DCMAKE_CXX_FLAGS="-include cstdint"
make
sudo make install

- name: CMake
run: mkdir build && cd build && cmake ..

- name: Build
run: cd build && make

# A voir plus tard pour CI/CD linux, windows, macos
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
cmake-build-debug/
build/
.idea/
49 changes: 49 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# How to use:
# mkdir build
# cd build
# cmake ..
# make
#
cmake_minimum_required(VERSION 3.10.2)

project(STANK
VERSION 0.1.0)

add_executable(stank src/client.cpp)

find_package(gf 1.2.0 REQUIRED COMPONENTS graphics)

target_link_libraries(stank
PRIVATE
gf::graphics
)

target_compile_options(stank
PRIVATE
"-Wall" "-Wextra" "-pedantic" "-g" "-O2"
)

set_target_properties(stank
PROPERTIES
CXX_STANDARD 17
CXX_EXTENSIONS OFF
)

add_executable(stank_server src/server.cpp)

target_compile_options(stank_server
PRIVATE
"-Wall" "-Wextra" "-pedantic" "-g" "-O2"
)

set_target_properties(stank_server
PROPERTIES
CXX_STANDARD 17
CXX_EXTENSIONS OFF
)

add_custom_command(TARGET stank POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory
"${CMAKE_CURRENT_SOURCE_DIR}/data/stank"
"$<TARGET_FILE_DIR:stank>/"
)
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,7 @@
# Stank
An online game made with gf in c++

![C++](https://img.shields.io/badge/c%2B%2B-%2300599C.svg?style=for-the-badge&logo=cplusplus&logoColor=white)
![CMake](https://img.shields.io/badge/CMake-%23008FBA.svg?style=for-the-badge&logo=cmake&logoColor=white)

An online game made with [GamedevFramework](https://gamedevframework.github.io/) made in C++!

Binary file added data/stank/DroidSans.ttf
Binary file not shown.
45 changes: 45 additions & 0 deletions src/client.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
//
// Created by azrotho on 09/10/2026.
//
#include <gf/Event.h>
#include <gf/Font.h>
#include <gf/RenderWindow.h>
#include <gf/Sprite.h>
#include <gf/Text.h>
#include <gf/Texture.h>
#include <gf/Window.h>
#include <iostream>

int main() {
std::cout << "Hello, World Client!" << std::endl;

gf::Window window("Example", { 640, 480 });
gf::RenderWindow renderer(window);
renderer.clear(gf::Color::White);

gf::Font font("DroidSans.ttf");

gf::Text text("Hello gf!", font, 50);
text.setColor(gf::Color4f(0.0f,0.0f,0.0f,1.0f));
text.setPosition({ 100, 100 });

while (window.isOpen()) {
// Process events
gf::Event event;
while (window.pollEvent(event)) {
switch (event.type) {
case gf::EventType::Closed:
window.close();
break;
default:
break;
}
}
// Draw the entities
renderer.clear();
//renderer.draw(sprite);
renderer.draw(text);
renderer.display();
}
return 0;
}
10 changes: 10 additions & 0 deletions src/server.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
//
// Created by azrotho on 09/10/2026.
//

#include <iostream>

int main() {
std::cout << "Hello, World Server!" << std::endl;
return 0;
}