GameLib is a collection of libraries for creating applications in Cakelisp.
Go to file
Macoy Madson a2bb9932ab Fix Windows build 2025-03-20 15:05:04 -04:00
src Fix Windows build 2025-03-20 15:05:04 -04:00
test Remove Github links, VCS work for many files 2024-11-06 15:08:51 -05:00
tools Version control UI work 2024-04-16 14:54:29 -04:00
.clang-format Got Ogre initialized 2020-10-10 17:56:19 -07:00
.gitattributes Fix using regular SDL_main on Windows 2023-05-26 16:08:09 -04:00
.gitignore Remove Github links, VCS work for many files 2024-11-06 15:08:51 -05:00
.gitmodules Removed remaining dependencies 2021-04-03 21:17:30 -07:00
COPYING Load meshes and create nodes separately 2020-11-01 14:36:03 -08:00
LICENSE Initial commit 2020-10-04 20:19:33 +00:00
ReadMe.org Add C scheduler 2024-10-18 17:47:13 -04:00

ReadMe.org

GameLib

GameLib started as a library for making games, but became a collection of generally useful modules for desktop applications as well.

GameLib is written in Cakelisp.

Setup

Please see cakelisp/doc/Tutorial_ProjectSetup.org for a step-by-step tutorial on how to set up a project to use Cakelisp and GameLib. Shorter instructions follow here.

Clone the repository:

git clone https://macoy.me/code/macoy/gamelib.git

By default, GameLib does not include any 3rd-party dependencies. The dependencies will be downloaded to a folder Dependencies/ as soon as you import their modules. This allows me to continue adding useful tools to GameLib without having it balloon into hour-long submodule downloading.

Build tests:

  cd test/
  ./Build.sh

This step will take a while the first time, because it builds Cakelisp, Ogre, SDL, and all the test programs. Subsequent executions will use the cakelisp_cache and will be much faster.

Note that changes to the 3rd-party dependencies will not automatically be detected.

Building Ogre tests

You may need to follow the instructions in the Asset pipeline section if you are failing during the Asset-Building stage. You may also comment out any VocalGame.cake lines in the build script to avoid building any assets.

Setting up for your project

  mkdir my-project
  cd my-project
  mkdir Dependencies
  git submodule add https://macoy.me/code/macoy/cakelisp/ Dependencies/cakelisp
  git submodule add https://macoy.me/code/macoy/gamelib/ Dependencies/gamelib

Then, copy the following script (you get the idea - build cakelisp, then build your project):

#!/bin/sh

CAKELISP_DIR=Dependencies/cakelisp

# Build Cakelisp itself
echo "\n\nCakelisp\n\n"
cd $CAKELISP_DIR
./Build.sh || exit $?

cd ../..

CAKELISP=./Dependencies/cakelisp/bin/cakelisp

echo "\n\nMy project\n\n"
$CAKELISP MyProject.cake || exit $?

You'll probably need the following search paths added to one of your .cake files:

  ;; Cakelisp
  (set-cakelisp-option cakelisp-src-dir "Dependencies/cakelisp/src")
  (add-cakelisp-search-directory "Dependencies/cakelisp/runtime")
  ;; Gamelib
  (add-cakelisp-search-directory "Dependencies/gamelib/src")

Refer to test/ for project setup.

Cleaning test

  ./test/RemoveSubmodules.sh

This shouldn't be necessary because test/ is set up to not clone dependencies as submodules, but if you are testing the submodules feature, this script helps undo them.

Platform setup

Ogre

You may need X11 headers to build on Ubuntu. You'll also need imagemagick and blender for the asset building:

  sudo apt install libx11-xcb-dev imagemagick blender

There is a TODO to automatically install these.

SDL2

On Ubuntu/Debian:

  sudo apt install automake autotools-dev libtool libegl1-mesa-dev

You may need to add libwayland-dev, but I'm not sure.

Testing wayland support:

  pkg-config --exists 'wayland-client >= 1.18' wayland-scanner wayland-egl wayland-cursor egl 'xkbcommon >= 0.5.0'
  echo $?

Module platform support

Modules don't necessarily support all platforms out of the box. If you are trying to use GameLib on one of these platforms, please let me know your results so I can update the table.

Here are the known compatibility results, where blank means untested/unknown:

Module Linux x86_64 Linux Arm v7 Windows x64 macOS
Allocator.cake Yes Yes Yes Yes
Aubio.cake Yes
AutoTest.cake Yes Yes Yes Yes
AutoUpdate.cake Yes Yes
AutoUpdateApplication.cake Yes Yes
CImGui.cake Yes Yes
CImGuiCpp.cake Yes Yes
Compression.cake Yes Yes
Config_ZigCompile.cake Yes
Config_ZigWindows.cake Yes
Cryptography.cake Yes Yes
Cryptography2.cake Yes Yes
Curl.cake Yes Yes
DataBundle.cake Yes Yes Yes
Dependencies.cake Yes Yes Yes
Dictionary.cake Yes Yes Yes Yes
Diff.cake Yes Yes Yes Yes
DynamicArray.cake Yes Yes Yes Yes
FileDialog.cake Yes Yes Yes
FileSystem.cake Yes Yes Yes
FreeType.cake Yes Yes
Hash.cake Yes Yes Yes Yes
HashStringTable.cake Yes Yes Yes Yes
Image.cake Yes Yes Yes
ImGui.cake Yes No[1] Yes
ImGuiSDLOpenGL.cpp Yes No[1] Yes
Introspection.cake Yes Yes Yes Yes
IntrospectionV2.cake Yes Yes Yes Yes
IntrospectionV2Utilities.cake Yes Yes Yes Yes
KeyManagement.cake Yes Yes Yes Yes
Licenses.cake Yes Yes Yes Yes
Lite.cake Yes Yes
Math.cake Yes Yes Yes Yes
Network.cake Yes Yes Yes
Noise.cake Yes Yes Yes Yes
Ogre.cake Yes
OgreInitialize.cake Yes
Oniguruma.cake Yes Yes
OpenGL.cake Yes No[1] Yes
OpenSSL.cake Yes
PDF.cake Yes Yes
ProfilerAutoInstrument.cake Yes Yes Yes Yes
ProfilerNull.cake Yes Yes Yes Yes
Protocol.cake Yes Yes Yes Yes
RandomPCG.cake Yes Yes Yes Yes
Raylib.cake Yes
RemoteCommands.cake Yes Yes Yes Yes
Scheduler.cake Yes Yes
SDL.cake Yes Yes
STB.cake Yes Yes Yes Yes
TaskSystem.cake Yes Yes
Timer.cake Yes Yes
TinyCCompiler.cake Yes Yes
Tracy.cake Yes
VersionedData.cake Yes Yes Yes Yes
WindowsHeader.cake Yes[2] Yes[2] Yes
WindowsInstaller.cake No No Yes No
XML.cake Yes Yes Yes Yes
XXHash.cake Yes Yes Yes Yes

[1] These programs rely on hard-coded OpenGL versions. TODO: Make it automatically decide to use OpenGL ES when necessary.

[2] This works on Linux only when an appropriate cross-compiler is being used, e.g. Config_ZigWindows.cake, or MinGW.

Automatic downloading

The following modules will automatically download their dependencies if missing:

  • Aubio.cake
  • CImGui.cake
  • Compression.cake
  • Cryptography.cake
  • Cryptography2.cake
  • Curl.cake
  • ZigCompile.cake[3]
  • Dictionary.cake
  • DynamicArray.cake
  • FreeType.cake
  • Image.cake
  • ImGui.cake
  • Lite.cake
  • Math.cake
  • Noise.cake
  • Ogre.cake
  • OgreInitialize.cake
  • Oniguruma.cake
  • OpenGL.cake
  • OpenSSL.cake
  • Raylib.cake
  • SDL.cake
  • STB.cake
  • TaskSystem.cake
  • TinyCCompiler.cake
  • Tracy.cake

[3] This uses curl to download a binary blob.

Unless otherwise specified, the download happens through git clone commands. You can stop downloading via editing src/Dependencies.cake to suppress the commands.

Terms

GameLib is copyright (C) 2020 Macoy Madson <macoy@macoy.me>.

Licensed under GPL-3.0-or-later.

Contact macoy@macoy.me if you would like to negotiate an exception for your use-case.