A simple, cross-platform 2D game engine.
Go to file
Attila Uygun 2c1d55fc30 Replace the build system with gn
No support for APKs, Java code etc. Keep using gradle for Android for now.
2023-08-03 11:32:28 +02:00
.vscode Replace the build system with gn 2023-08-03 11:32:28 +02:00
assets Replace the build system with gn 2023-08-03 11:32:28 +02:00
build Replace the build system with gn 2023-08-03 11:32:28 +02:00
src Replace the build system with gn 2023-08-03 11:32:28 +02:00
.clang-format Remove OpenGL threaded rendering 2023-06-26 20:03:22 +02:00
.gitignore Update android build 2023-05-09 22:22:02 +02:00
.gn Replace the build system with gn 2023-08-03 11:32:28 +02:00
BUILD.gn Replace the build system with gn 2023-08-03 11:32:28 +02:00
LICENSE Initial commit. 2020-09-08 21:08:07 +02:00
README.md Replace the build system with gn 2023-08-03 11:32:28 +02:00
privacy.md Update. 2021-02-10 00:39:04 +01:00

README.md

Kaliber

A simple, cross-platform 2D game engine with OpenGL and Vulkan renderers. Supports Linux and Android platforms. This is a personal hobby project. I've published a little game on Google Play based on this engine. Full game code and assets are included in this repository.

Pre-requisities for all platforms except Android:

Install:

Building from the command-line:

All platforms except Android:

Setup:

gn gen out/release
gn gen --args='is_debug=true' out/debug

Building and running:

ninja -C out/debug
./out/debug/hello_world
./out/debug/demo

Android:

cd build/android
./gradlew :app:installDebug

Third-party libraries:

glew, jsoncpp, minimp3, oboe, stb, texture-compressor, minizip, glslang, spirv-reflect, vma, vulkan-sdk, volk

Hello World example:

Shows a smoothly rotating "Hello Wolrd!".

class HelloWorld final : public eng::Game {
 public:
  ~HelloWorld() final = default;

  bool Initialize() final {
    eng::Engine::Get().SetImageSource(
        "hello_world_image",
        std::bind(&eng::Engine::Print, &eng::Engine::Get(), "Hello World!",
                  base::Vector4f(1, 1, 1, 0)));

    hello_world_.Create("hello_world_image");
    hello_world_.SetVisible(true);
    animator_.Attach(&hello_world_);
    animator_.SetRotation(base::PI2f, 3,
                          std::bind(base::SmootherStep, std::placeholders::_1));
    animator_.Play(eng::Animator::kRotation, true);
    return true;
  }

 private:
  eng::ImageQuad hello_world_;
  eng::Animator animator_;
};

DECLARE_GAME_BEGIN
DECLARE_GAME(HelloWorld)
DECLARE_GAME_END