Elektrine lite

← Feed

@demofox@mastodon.gamedev.place

Post #2017523

2026-02-12 03:50 UTC

Hey All, I made a header only C++ library where it's 1 line of code to init, then you can start writing to pixels on the screen. I call it thirteen.h, as it is inspired by the simplicity of the 13h days. Examples include a mandelbrot viewer and a playable mine sweeper game. MIT licensed. https://github.com/Atrix256/Thirteen

Replies (30)

  • There are some really cool path tracing renders using this lib over on bsky. Two of em attached. https://bsky.app/profile/hikey.org/post/3mes7ko7f6s22

    Open ##3118800

  • @aeva@mastodon.gamedev.place 2026-02-12 03:59

    @demofox@mastodon.gamedev.place mondo cool!!! :O

    Open ##3118801

  • @demofox@mastodon.gamedev.place Cool stuff! I used to use SDL to draw to screen from CPU, but this feels much easier for someone to start. DX12 means it won't be easy to use on Linux, though

    Open ##3118803

  • @demofox@mastodon.gamedev.place my god the naming alone is beyond genius

    Open ##3118806

  • @bnut@aus.social 2026-02-12 04:18

    @demofox@mastodon.gamedev.place sounds cool! I used to use this library for those purposes about 20 years ago, but it hasn’t been updated for several years https://github.com/thedmd/pixeltoaster

    Open ##3118808

  • @echoparallax@mathstodon.xyz 2026-02-12 04:26

    @demofox@mastodon.gamedev.place Nice!

    Open ##3118811

  • @demofox@mastodon.gamedev.place This is so cool. Well done!

    Open ##3118812

  • @demofox@mastodon.gamedev.place excellent! Very reminiscent of the minifb Rust crate by @daniel_collin@mastodon.gamedev.place

    Open ##3118813

  • @demofox@mastodon.gamedev.place mmm windows, I wonder, what about a linux framebuffer version.. hmmm...

    Open ##3118814

  • @demofox@mastodon.gamedev.place I find it a bit funny that like myself, everybody else seems to have checked the platform compatibility first =)

    Open ##3118816

  • @root42@chaos.social 2026-02-12 06:14

    @demofox@mastodon.gamedev.place now we need this with a Vulkan and Metal backend.

    Open ##3118821

  • @demofox@mastodon.gamedev.place Years since I saw Three.js, but so cool to see them grow up to be Thirteen.h 👏

    Open ##3118822

  • @demofox@mastodon.gamedev.place oh this is marvelous, great work! How's the performance overhead? I imagine it's not too bad since this seems to mostly be a fancy data serialization wrapper for DX12 so probably the heaviest part of this is the user iterating over the pixel array (I'm pretty new to graphics programming myself so I might be off-base here). Also any plans to port the library to C?

    Open ##3118823

  • @termoose@snabelen.no 2026-02-12 07:38

    @demofox@mastodon.gamedev.place ohhhh love this, was just looking for something similar and found good old tinyptc dead in the water. This looks great!

    Open ##3118827

  • @demofox@mastodon.gamedev.place Looks great, love the name. :D I was going to say wouldn't this make sense to have as just a single .h _and_ a single .cpp, but I guess a huge use case is just getting up and running very quickly and then you might not have a build system anyway.

    Open ##3118828

  • @oblomov@sociale.network 2026-02-12 08:47

    @demofox@mastodon.gamedev.place thank you very much.

    Open ##3118831

  • @demofox@mastodon.gamedev.place Kudos! Wonderful idea. And great API :)

    Open ##3118832

  • @kawa@mas.to 2026-02-12 18:43

    @demofox@mastodon.gamedev.place (Superintendent Chalmers voice) Hmmh, and you call it thirteen, when it clearly takes more after VESA?

    Open ##3118833

  • @demofox@mastodon.gamedev.place flagging @robertcarlson@mastodon.gamedev.place for possible interest...

    Open ##3118834

  • @gsuberland@chaos.social 2026-02-12 18:56

    @demofox@mastodon.gamedev.place this pwns :D

    Open ##3118835

  • @leeloo@chaosfem.tw 2026-02-12 18:59

    @demofox@mastodon.gamedev.place Maybe start out by saying that it's Win32. You are posting on a social network popular mong people who are leaving the big Facebook/Twitter/Microsoft/Google behind.

    Open ##3118836

  • @demofox@mastodon.gamedev.place Are you going to apply to have the URI for that repo listed in https://github.com/jezen/is-thirteen ? (For example: https://github.com/jezen/is-thirteen/blob/072d560621a88025a6fecf5b7fb619bdb8ce52d4/consts.js#L59 )

    Open ##3118838

  • @demofox@mastodon.gamedev.place I built something like this but for macOS many moons ago for a friend who wanted to get his kid interested in programming! It was great, I was able to make a demo Pong game in about 100 LOC using my lib. Note: It did NOT interest his kid in programming

    Open ##3118842

  • @demofox@mastodon.gamedev.place I was excited to see this and then saw the DirectX limitation. I wanted to use this on my Pi displays.

    Open ##3118844

  • @feiss@c.im 2026-02-12 23:44

    @demofox@mastodon.gamedev.place may I say I love you? Some years ago I made this https://github.com/feiss/zero which aimed to something very similar, and tried (without success, got distracted) to port it to many languages and platforms (under a similar API) So I can say I love this!!! Long life 13h mode! (And also indexed modes! https://github.com/feiss/indexed )

    Open ##3118847

  • @sol_prog@mastodon.social 2026-02-13 04:28

    @demofox@mastodon.gamedev.place Cool library! For compilation on macOS one can use (maybe you want to add this to the readme file, could be useful for some people): clang++ main.cpp -framework Metal -framework Cocoa

    Open ##3118848

  • @renardboy@mastodon.social 2026-02-13 13:55

    @demofox@mastodon.gamedev.place That's really awesome! Looking forward to the Linux support!

    Open ##3118850

  • @dave@pdx.social 2026-02-13 20:56

    @demofox@mastodon.gamedev.place this is wonderful, thank you! n.b. on macOS I also had to add the flags -std=c++11 -DTARGET_OS_OSX

    Open ##3118851

  • @pLaw@mastodon.online 2026-02-14 12:10

    @demofox@mastodon.gamedev.place thank you! That is exactly what I was looking for for quite a while now!

    Open ##3118853

  • @pkhuong@discuss.systems 2026-02-14 12:42

    @demofox@mastodon.gamedev.place I'll try to introduce the kid to that. Are you open to an fps target functionality?

    Open ##3118854