SMK (Simple multimedia kit)

header

Features:

  • Compatible with WebAssembly. One build for every platforms!
  • Fast & simple.
  • No dependencies: everything is fetched using cmake FetchContent.

Ready to start?

Open a new Window:

auto window = smk::Window(640, 480, "Title");
A window. You can draw objects on the window.
Definition: Window.hpp:31

The main loop:

void loop() {
window.Clear(smk::Color::Black);
[...] // Draw stuff
window.Display();
}
const glm::vec4 Black
Black.
Definition: Color.cpp:30

Images

Load textures:

auto ball_texture = smk::Texture("./ball.png");

Display images:

auto ball_sprite = smk::Sprite(ball_texture);
ball_sprite.SetPosition({200,200});
window.Draw(ball_sprite);

Text

Load font:

auto font_arial = smk::Font("./arial.ttf", 32);

Display text:

auto text = smk::Text(font_arial, "hello world");
text.SetPosition({200,200});
window.Draw(text);
A class for displaying text.
Definition: Text.hpp:37

Sound

Load sound:

auto sound_buffer = smk:SoundBuffer("./boing.ogg");

Play sound:

auto sound = smk::Sound(sound_buffer);
sound.Play();
Represent a sound being played.
Definition: Sound.hpp:31

Transform the view

auto view = smk::View();
view.SetCenter({200, 200});
view.SetSize(320,240);
window.SetView(view);

Examples:

Games made using SMK