ona/readme.md

89 lines
3.1 KiB
Markdown
Raw Normal View History

2023-02-18 03:34:40 +00:00
# Ona
![Screenshot of Ona rendering a CRT display distrotion effect on the default texture](promo/effects.png)
2023-02-18 03:34:40 +00:00
## Table of Contents
1. [Overview](#overview)
1. [Goals](#goals)
1. [Technical Details](#technical-details)
1. [Requirements](#requirements)
1. [Building](#building)
2024-07-25 14:26:39 +01:00
1. [Packaging](#packaging)
2023-02-18 03:34:40 +00:00
## Overview
Ona is the Catalan word for "wave".
2023-02-18 03:34:40 +00:00
Ona is also a straightforward game engine with the aim of staying reasonably lightweight through a modular architecture.
2023-02-18 03:34:40 +00:00
## Goals
2023-04-19 01:34:06 +02:00
* Fully-featured two-dimensional raster and vector rendering capabilities.
2023-02-18 03:34:40 +00:00
2023-05-28 12:52:16 +00:00
* Support major computer gaming ecosystems; Namely Microsoft Windows, SteamOS, Unix-like systems, and the web.
2023-02-18 03:34:40 +00:00
2023-04-19 01:34:06 +02:00
* Minimize external dependencies.
2023-02-18 03:34:40 +00:00
2023-05-28 12:52:16 +00:00
* Provide utilities for handling rendering but otherwise leave the higher-level game logic and data structuring to the programmer.
2023-02-18 03:34:40 +00:00
2024-06-20 23:16:49 +02:00
* Enforce an architecture that makes non-interdependent logic trivially parallelizable.
2024-06-20 23:16:29 +02:00
2023-02-18 03:34:40 +00:00
## Technical Details
### Requirements
Ona currently depends the following third-party tools to build it:
* Platform support for SDL2 at version 2.0.20 installed via the standard shared binary format redistributable.
2023-04-19 01:34:06 +02:00
* Zig compiler toolchain.
2023-02-18 03:34:40 +00:00
As the project evolves, dependencies on libraries external to the project codebase will be minimized or removed outright to meet the goals of the project as closely as possible.
### Building
Running the `zig build` command will build the everything. To learn how to consume the project as a library, see the [packaging](#packaging) section.
For simple experimentation without creating a standalone Zig project, new demos may be freely created within the `src/demos` folder; The build script will automatically detect them and `zig build demos` step will automatically (re)build it along with everything else.
The unit testing suite for the engine modules may be built and ran via `zig build tests`.
### Packaging
To reduce the amount of setup work, a [project template is provided](https://sauce.pizzawednes.day/kayomn/ona-template) that will open a window and show the default texture on the middle of the screen. If you decide to use this project, the steps below can be skipped.
1. Create a new Zig project if you have not already.
2. Create a `build.zig.zon` accompanying your `build.zig` if you do not already have one.
3. Your `build.zig.zon` should, at minimum, contain the following dependency listed in the dependencies section:
```zig
.{
.dependencies = .{
.ona = .{ .path = "path/to/ona/repo" },
},
}
```
4. Add a package declaration for Ona to your `build.zig` and add the relevant modules to your application.
```zig
const ona_dependency = b.dependency("ona", .{
.target = target,
.optimize = optimize,
});
const app = b.addExecutable(.{
.name = "My Ona App",
.target = target,
.optimize = optimize,
.root_source_file = b.path("src/main.zig"),
});
app.root_module.addImport("ona", ona_dependency.module("ona"));
app.root_module.addImport("coral", ona_dependency.module("coral"));
b.installArtifact(app);
```
5. Create a `main.zig` containing a valid Ona app declaration.
6. Run `zig build` to build your new game application.