kaliber/README.md

70 lines
2.2 KiB
Markdown

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](https://play.google.com/store/apps/details?id=com.woom.game)
based on this engine. Full game code and assets are included in this repository.
#### Building the demo
Linux:
```text
cd build/linux
make
```
Android:
```text
cd build/android
./gradlew :app:assembleRelease
```
#### Third-party libraries:
[glew](https://github.com/nigels-com/glew),
[jsoncpp](https://github.com/open-source-parsers/jsoncpp),
[minimp3](https://github.com/lieff/minimp3),
[oboe](https://github.com/google/oboe),
[stb](https://github.com/nothings/stb),
[texture-compressor](https://github.com/auygun/kaliber/tree/master/src/third_party/texture_compressor),
[minizip](https://github.com/madler/zlib/tree/master/contrib/minizip),
[glslang](https://github.com/KhronosGroup/glslang),
[spirv-reflect](https://github.com/KhronosGroup/SPIRV-Reflect),
[vma](https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator),
[vulkan-sdk](https://vulkan.lunarg.com),
[volk](https://github.com/zeux/volk)
#### Hello World example:
Simply shows a rotating "Hello Wolrd!".
```cpp
#include "base/interpolation.h"
#include "engine/animator.h"
#include "engine/asset/image.h"
#include "engine/engine.h"
#include "engine/game.h"
#include "engine/game_factory.h"
#include "engine/image_quad.h"
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
```