diff --git a/.gitignore b/.gitignore index 259148f..6b51814 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,9 @@ *.exe *.out *.app + +build +.cache +.xmake + +compile_commands.json diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index 2a19646..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,10 +0,0 @@ - -# You are free to modify this file - -cmake_minimum_required(VERSION 3.0) -project(game) -find_package(X11 REQUIRED) -set(CMAKE_CONFIGURATION_TYPES "Debug" "Release") -file(GLOB SRC *.cpp) -add_executable(game ${SRC}) -target_link_libraries(game m X11) diff --git a/README.md b/README.md index eeea0d5..708d5f5 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,10 @@ -# Game Template (Linux) +# Game (Linux) -A simple framework for prototyping games. \ -The framework provides a video buffer and simple keyboard and mouse input. +Game, based on https://github.com/imp5imp5/game_template_linux. ### Build -``sudo apt install g++ cmake libx11-dev`` \ -``mkdir build && cd build`` \ -``cmake -DCMAKE_BUILD_TYPE=Release ..`` \ -``make`` +``sudo apt install g++ cmake libx11-dev xmake`` \ +``xmake`` + +### Run +``xmake run`` diff --git a/Engine.h b/include/Engine.h similarity index 100% rename from Engine.h rename to include/Engine.h diff --git a/Engine.cpp b/src/Engine.cpp similarity index 100% rename from Engine.cpp rename to src/Engine.cpp diff --git a/Game.cpp b/src/Game.cpp similarity index 100% rename from Game.cpp rename to src/Game.cpp diff --git a/xmake.lua b/xmake.lua new file mode 100644 index 0000000..15537b6 --- /dev/null +++ b/xmake.lua @@ -0,0 +1,14 @@ +add_requires("libx11") + +add_rules("mode.debug", "mode.release") + +set_languages("c++20") + +target("game") + set_kind("binary") + add_includedirs("include") + -- add_includedirs(os.dirs(path.join(os.scriptdir(), "include/**"))) + add_files("src/**.cpp") + add_packages("libx11") + set_warnings("allextra") + set_rundir("$(projectdir)")