Skip to content
SMK - Simple multimedia kit - C++ WebAssembly
C++ Other
  1. C++ 99.0%
  2. Other 1.0%
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
doc
examples
include/smk
src/smk
third_party
tools
.clang-format
CMakeLists.txt
LICENSE
README.md

README.md

SMK (Simple multimedia kit)

header

Story:

I needed to port several games made using the
[SFML](https://www.sfml-dev.org/) to WebAssembly. SFML isn't supporting
WebAssembly (yet), so I had to reimplement it myself. If you know the SFML, then
SMK must be very familiar to you.

Features:

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

Ready to start? See tutorial on how to depend on the smk.

Opening a new Window:

  auto screen = smk::Screen(640, 480, "Title");

The main loop:

  void loop() {
    screen.Clear(smk::Color::Black);

    [...] // Draw stuff

    screen.Display();
  }

Images

Loading textures

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

Displaying image

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

Text

Loading font

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

Displaying text

  auto text = smk::Text(font_arial, "hello world");
  text.SetPosition({200,200});
  screen.Draw(text);

Sound

Loading sound.

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

Playing sound.

  auto sound = smk::Sound(sound_buffer);
  sound.Play();

Transforming the view

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

Games made using SMK

(Feel free to add yours)

Thanks

SMK depends directly on many great projects listed below:

SMK is also made possible thanks to (indirectly dependencies, tools used, non-exhaustive):

You can’t perform that action at this time.