This release focuses on supporting Android as a target platform as well as making the process of creating a game much simpler. Previously, game templates were created using the CreateGame.py
script, which has now been replaced by a ready-to-run game template located in the MyGame
folder.
MyGame
additionally comes with a CMakePresets.json
file which uses CMake Presets to simplify the build process substantially. Lastly, shell scripts are included in the package that generate ready-to-use projects for Visual Studio and Xcode.
What’s new
- Support for targeting Android
- Folder
MyGame/AndroidProject
contains a preconfigured project that can be directly opened in Android Studio. - Requires OpenGL ES 3.0 support, which is supported by more than 95% of all Android devices.
- Folder
- Improve event handling by exposing events as virtual methods in the Game class
- This replaces the
std::variant
-basedEvent
type that required a visitor pattern. - Now, simply override a method in your Game class for the event you want to handle.
- This replaces the
- Add tweening
- New class:
cer::Tween
- New functions in namespace
cer::tween
to be used in conjunction with theTween
class
- New class:
- Change static colors from variables to methods
- Example:
Color::CornflowerBlue
now becomesColor::CornflowerBlue()
- Example:
- Change
Matrix::Zero
variable to a function, i.e.Matrix::Zero()
- Remove
ASSETS_DIR
parameter in thecerlib_add_executable
function. The game asset folder is now called"Assets"
and is unchangeable. - The game template now specifies its source files in a separate file called
files.cmake
- Add
GenerateVisualStudioProject.bat
to the game template- Convenience script that creates a Visual Studio 2022 project for the game
- Add
GenerateXcodeProject.command
to the game template- Convenience script that creates an Xcode project for the game
- Add
ImageFormat::Unknown
- Default-initialize
DisplayMode
members - Add
Image::GetSizeInBytes()
- Add an
Image
constructor that loads an image from a file on disk. This function is only supported on desktop platforms. Calling it on non-desktop platforms will raise an error. - Add
cer::GetCurrentCanvas()
- Gets the current canvas that was set by
cer::SetCanvas()
- Gets the current canvas that was set by
- Add
cer::GetCanvasDataInto()
andcer::GetCanvasData()
- Gets the pixel data that is currently stored in a
Canvas
- Gets the pixel data that is currently stored in a
- Add
cer::SaveCanvasToFile()
andcer::SaveCanvasToMemory()
- Saves the pixel data of a canvas as converted image data, such as PNG or JPEG
- New enum:
ImageFileFormat
- Remove
Game::FirstUpdateOfFrame()
- Improved documentation of various types