# New SDL+Cairo bindings pack

**URL:** <https://swi-prolog.discourse.group/t/new-sdl-cairo-bindings-pack/9794>\
**Category:** General\
**Created:** [August 22, 2026, 1:12pm UTC](https://swi-prolog.discourse.group/t/new-sdl-cairo-bindings-pack/9794 "2026-08-22T13:12:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kwon-young](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/kwon-young/32/4841_2.png) [@kwon-young](https://swi-prolog.discourse.group/u/kwon-young)\
**Post date:** [August 22, 2026, 1:12pm UTC](https://swi-prolog.discourse.group/t/new-sdl-cairo-bindings-pack/9794/1 "2026-08-22T13:12:00Z")

</div>

Hello,  
I’ve just finished cleaning up my SDL and Cairo bindings: [GitHub - kwon-young/sdlpl: SWI-Prolog bindings to SDL · GitHub](https://github.com/kwon-young/sdlpl)  
Here are main features of the bindings:

- true 1 to 1 bindings of SDL and Cairo API.
- Memory safe: SDL and Cairo handles/resources are represented with a blob. when blob are garbage collected resources are automatically freed.
- Garbage collection safe: dependencies between resources are tracked through atom references, meaning that garbage collection will destroy things in correct order.
- SDL software rendering
- SDL explicit full gpu rendering ! See the pong example with shader and all: [sdlpl/examples/pong\_gpu.pl at 55dde69de685202b6bdbcfa476c973f6eba0a45f · kwon-young/sdlpl · GitHub](https://github.com/kwon-young/sdlpl/blob/55dde69de685202b6bdbcfa476c973f6eba0a45f/examples/pong_gpu.pl)
- Cairo drawing in a SDL surface. Also a pong example: [sdlpl/examples/pong2.pl at 55dde69de685202b6bdbcfa476c973f6eba0a45f · kwon-young/sdlpl · GitHub](https://github.com/kwon-young/sdlpl/blob/55dde69de685202b6bdbcfa476c973f6eba0a45f/examples/pong2.pl)

Unfortunately, I don’t seem to be able to publish the pack:

```prolog
$ swipl pack publish 'https://github.com/kwon-young/sdlpl'               
Installation plan:
  Install sdlpl at version 0.0.0 from https://github.com/kwon-young/sdlpl
Download packs? Y/n? 
Cloning into '/tmp/swipl_pack_1164548_1/sdlpl'...
Already up to date.
The following packs have post install scripts:
  Build sdlpl in directory /tmp/swipl_pack_1164548_1/sdlpl
Run scripts? Y/n? 
% Building pack sdlpl in directory /tmp/swipl_pack_1164548_1/sdlpl
-- The CXX compiler identification is GNU 16.1.1
....
[12/12] Linking CXX shared module /tmp/swipl_pack_1164548_1/sdlpl/lib/x86_64-linux/sdl.so
-- Install configuration: "Release"
Test project /tmp/swipl_pack_1164548_1/sdlpl/build
    Start 1: sdl
1/1 Test #1: sdl .............................. Passed 35.91 sec

% 100% tests passed, 0 tests failed out of 1
% 
% Total Test time (real) = 35.91 sec
% Contacting server at https://www.swi-prolog.org/pack/query ... ok
ERROR: [Thread main] Pack sdlpl at version 0.3.0 failed for unknown reason (false)

```

@jan would you have an idea why it failed ?

---

<div class="post-metadata">

**Author:** ![jan](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/jan/32/4_2.png) [@jan](https://swi-prolog.discourse.group/u/jan)\
**Post date:** [August 23, 2026, 3:10pm UTC](https://swi-prolog.discourse.group/t/new-sdl-cairo-bindings-pack/9794/2 "2026-08-23T15:10:53Z")

</div>

t could be that the pack name in pack.pl dpes not match the repository name. Of course, this should give a better error.

---

<div class="post-metadata">

**Author:** ![kwon-young](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/kwon-young/32/4841_2.png) [@kwon-young](https://swi-prolog.discourse.group/u/kwon-young)\
**Post date:** [August 24, 2026, 9:55am UTC](https://swi-prolog.discourse.group/t/new-sdl-cairo-bindings-pack/9794/3 "2026-08-24T09:55:38Z")

</div>

> [@jan](#):
>
> the pack name in pack.pl dpes not match the repository name.

That was it ! Thank you so much.  
The pack is now published and can be installed using `pack install sdlpl`.  
You of course needs sdl3 sdl3\_image and cairo developement headers and installed for the pack to work.  
If anyone needs more api coverage, you can simply open an issue on github.  
If you want to discuss the bindings design, don’t hesitate to post here.

---

<div class="post-metadata">

**Author:** ![kwon-young](https://yyz2.discourse-cdn.com/free1/user_avatar/swi-prolog.discourse.group/kwon-young/32/4841_2.png) [@kwon-young](https://swi-prolog.discourse.group/u/kwon-young)\
**Post date:** [August 26, 2026, 12:00pm UTC](https://swi-prolog.discourse.group/t/new-sdl-cairo-bindings-pack/9794/4 "2026-08-26T12:00:29Z")

</div>

@jan Sorry to bother you again, but it seems my failed attempts registered an additional pack named `sdl`: ["sdl" pack for SWI-Prolog](https://www.swi-prolog.org/pack/list?p=sdl)  
could you delete it from the list ?  
the correct pack name is sdlpl which is correctly published now.
