Octarine is a game engine written in C for C/C++ designed to be used on 2D games with fixed-timestep logic. The renderer is able to automatically interpolate draws to render at unlocked framerates while the user need not concern themselves with anything other than game logic.
Warning
Octarine was made and continues to exist soley as a way for me to make jam games quickly in a comfortable environment. To this end, it's quite stable and has more than enough features to make game dev much quicker, but it will likely not recieve new features unless someone PRs them or I want them in a future jam.
- Logic is done on its own thread, drawing must be done by queueing draws for the main thread
- Fixed-timestep logic with interpolation makes physics incredibly simple without sacrificing visuals
- Performant and safe(r) allocators are provided for the user
- Fixed time-step with interpolation is the default and incredibly simple to use (and quite fast!)
- Robust asset bundle system that works with directories or archives (Thanks PhysFS!)
This example program displays a rectangle going in circles, where the rectangle will be drawn at an uncapped, interpolated
framerate but the update function will only update 30 times a second. To see the difference, draw another
rectangle near the original one without interpolation and you will see the difference clear as day.
#include <oct/Octarine.h>
#include <math.h>
void *startup() {
// ...
}
void *update(void *ptr) {
oct_DrawRectangleInt(
ctx,
OCT_INTERPOLATE_ALL, 1,
&(Oct_Rectangle){
.position = {320 + (cosf(oct_Time(ctx)) * 200), 240 + (sinf(oct_Time(ctx)) * 200)},
.size = {40, 40}
},
true, 0
);
}
void shutdown(void *ptr) {
// ...
}
int main(int argc, const char **argv) {
Oct_InitInfo initInfo = {
.sType = OCT_STRUCTURE_TYPE_INIT_INFO,
.startup = startup,
.update = update,
.shutdown = shutdown,
.argc = argc,
.argv = argv,
.windowTitle = "Octarine",
.windowWidth = 640,
.windowHeight = 480,
.debug = true,
};
oct_Init(&initInfo);
return 0;
}| Library | Purpose | License |
|---|---|---|
| Vulkan2D | Rendering | zlib |
| SDL3 | Windowing/input/threads/audio | zlib |
| SDL3_ttf | Font rendering | zlib |
| mi-malloc | Memory management | MIT |
| PhysicsFS | Asset system | zlib |
| stb_vorbis | Parsing OGGs | MIT |
| cJSON | Parsing JSONs | MIT |
| VulkanMemoryAllocator (VMA) | Vulkan2D uses it | MIT |
| tinyobjloader-c | Vulkan2D uses it | MIT |
| stb_image | Vulkan2D uses it | MIT |
| FreeType | SDL3_ttf uses it | FTL |
| HarfBuzz | SDL3_ttf uses it | MIT |
| PlutoSVG | SDL3_ttf uses it | MIT |
| PlutoVG | SDL3_ttf uses it | MIT |
