Insula is a framework written in Odin (a C-like programming language) designed for 2D game development and graphical applications. It provide modular libraries for OpenGL/WebGL rendering, audio abstraction, window management, and 2D physics, making a powerful and flexible tool for developpers.
- Built from scratch: inspired by Crow2D, Raylib and Love2D
- Highly modular: Insula is being designed to allow developers to replace its core libraries with alternative solutions, enabling full customization
Insula includes the following libraries by default:
- Ogygia: Handles 2D rendering using OpenGL/WebGL.
- 🚧 Missing features: Certain OpenGL bindings (e.g., framebuffer support) are not yet implemented
- Avalon: Manage window creation and handling.
- 🚧 Missing features: Gamepad support is not yet available.
- Sirenuse: Provides audio processing and playback.
- 🚧 Status: Basic implementation.
Here's a simple example of how to use Insula to create a window and render basic shape:
package main
import ins "insula"
import "core:fmt"
SCREEN_WIDTH :: 800
SCREEN_HEIGHT :: 600
fini :: proc(ctx: ^ins.Context) {
ins.render_destroy()
}
update :: proc(ctx: ^ins.Context, dt: f32) {
ins.draw_rect({10, 10}, {100, 100}, color = ins.RED)
ins.draw_all()
}
init :: proc(ctx: ^ins.Context) -> bool {
when ODIN_OS != .JS {
ins.load_extensions(ins.gl_set_proc_address)
} else {
ins.load_extensions("game")
}
if !ins.render_init(ctx.screen_width, ctx.screen_height) {
fmt.eprintln("Could not init GL context for some reason")
return false
}
ins.set_background(ins.WHITE)
return true
}
main :: proc() {
if !ins.init(SCREEN_WIDTH, SCREEN_HEIGHT, "Hello world", init, update, fini) {
panic("Something went wrong")
}
ins.start()
}To see Insula in action, you can try our online game demo:
- Spacebattle: A port of my game Spacebattle, originally written in C using SDL2, now powered by Insula.
Here are the planned steps for the project's development:
- Add missing OpenGL/WebGL bindings in Ogygia
- implement gamepad support in Avalon
- Develop and integrate the audio system for both desktop and Web (Sirenuse)
- Expand documentation and create tutorials