malena 1.0 is here

Build interactive
C++ applications
with confidence

An event-driven framework built on SFML. Compose behavior with traits, manage plugins safely, and ship polished UI — without the boilerplate.

Read the docs
Free for noncommercial use  ·  C++17  ·  macOS, Linux, Windows
MyApp.h
Manifest.h
main.cpp
#include <Malena/Engine/App/Application.h>
#include <Malena/Graphics/Primitives/Rectangle.h>

class MyApp : public ml::Application
{
public:
    MyApp() : Application(1280, 720, 32, "My App") {}

    void onInit() override
    {
        _panel.setSize({300.f, 160.f});
        _panel.setFillColor(sf::Color(83, 74, 183));
        _panel.setPosition({100.f, 100.f});
        addComponent(_panel);
    }

    void onReady() override
    {
        _panel.onClick([this]{ _panel.setFillColor(sf::Color::Green); });
        _panel.onHover([this]{ _panel.setFillColor(sf::Color(120, 80, 220)); });
        _panel.onUnhover([this]{ _panel.setFillColor(sf::Color(83, 74, 183)); });
    }

private:
    ml::Rectangle _panel;
};
class MyManifest : public ml::Manifest
{
public:
    static constexpr const char* name    = "My Plugin";
    static constexpr const char* version = "1.0.0";

    enum class Images  { Background, Player };
    enum class Fonts   { Main };
    enum class Flag    { Selected, Active };
    enum class State   { Idle, Running };

private:
    inline static const auto _ = [](){
        set(Images::Background, "assets/bg.png");
        set(Images::Player,     "assets/player.png");
        set(Fonts::Main,        "assets/main.ttf");
        return 0;
    }();
};
#include "MyApp.h"

int main()
{
    MyApp app;
    app.run();  // enters the main loop
    return 0;
}

Why malena
Everything you need to build
Traits compose behavior. Manifests declare resources. Plugins extend safely. You focus on the app.

Trait-based composition

Mix in Subscribable, Flaggable, Draggable, and Positionable without deep inheritance. Behavior composes cleanly at compile time.

Event-driven messaging

Two channels — string-keyed events for UI input, typed enum messages for plugins. Deferred operations prevent iterator crashes.

Safe plugin system

Load and unload dylibs at runtime. Deferred cleanup ensures no use-after-free when a plugin tears itself down inside a callback.

Manifest resources

Declare textures, fonts, and sounds in a manifest struct. AssetsManager loads and caches them — no manual file paths scattered in code.

SFML idioms preserved

window.draw() still works. sf::Vector2f, sf::Color, sf::Texture — unchanged. Malena adds structure, not a new API to learn.

Animated movement

moveTo() and moveDistance() with LINEAR or EXPONENTIAL easing built into every Positionable. No animation library needed.


Quick start
Up and running in minutes
1

Create your application

Inherit ml::Application and override two methods

2

Add components

Create framework objects and register them in onInit()

3

Subscribe to events

Wire up onClick, onHover, onUpdate in onReady()

4

Declare a manifest

Register assets and custom flags in a manifest struct

5

Run

Call app.run() and enter the main loop

MyApp.h C++17

    

Learn
Tutorials
See all tutorials →
Beginner

Your first Malena app

Build a window with a colored rectangle that responds to clicks and hover events.

10 minC++17
Beginner

Working with manifests

Declare textures, fonts, and custom flags. Load assets through AssetsManager.

15 minManifests
Intermediate

Trait composition

Mix Draggable, Flaggable, and custom state machines into a single component.

20 minTraits
Intermediate

Building a Carousel

Add a game-selection carousel with shader effects and navigation arrows.

25 minGraphics
Intermediate

Plugin system

Create a plugin with PluginWith, export it with REGISTER_PLUGIN, and load it at runtime.

30 minPlugins
Advanced

Console with Plugibs

Build a console that can lazy load plugins.

45 minGame Console

Start building today

Full API reference, Doxygen docs, and example projects included.

Read the docs View on GitHub

Licensing
Free to build with. Fair when you sell.
Malena is source-available under the PolyForm Noncommercial license — free for anything that isn't making money, with a simple paid license when it is.

Noncommercial — free, forever

Personal · learning · research · nonprofits

Use, modify, and share Malena freely for any noncommercial purpose under the PolyForm Noncommercial 1.0.0 license. No sign-up, no cost.

Commercial — paid license

Businesses · products you sell

Using Malena in or for a business, or in a product you sell? A commercial license covers you. Tell me about your project using the form and I'll follow up by email.

Request a commercial license
Tell me about your project and I'll get back to you.