Skip to content

dinau/sdl3_nim

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sdl3_nim


alt alt

SDL3 wrapper for Nim language with futhark converter.

  • SDL3: 3.2.16 (2025/06)
  • SDL_ttf: 3.2.2
  • Windows OS 10 or later
  • Linux Debian / Ubuntu families
  • Try to use ImGuin SDL3 example

Install


First delete old version

nimble uninstall sdl3_nim

then

nimble install https://github.com/dinau/sdl3_nim 

For Linux OS


  • If the package manager of the OS has SDL3 and SDL_ttf packages, install them with the package manager
  • If the package manager of the OS doesn't have SDL3 and SDL_ttf packages, install them from source code as follows (on Debian / Ubuntu families),
    1. Download source code from SDL3 and SDL3_ttf

    2. Install build tool Ninja

      sudo apt install ninja-build
    3. Extract SDL3 zip file and

      cd SDL-release-3.2.16 
      mkdir build
      cd build 
      cmake .. -GNinja -DCMAKE_INSTALL_PREFIX=/usr/local
      ninja
      sudo ninja install
      sudo ldconfig
    4. Extract SDL3_ttf zip file and

      cd SDL_ttf-release-3.2.2 
      mkdir build
      cd build 
      cmake .. -GNinja -DCMAKE_INSTALL_PREFIX=/usr/local
      ninja
      sudo ninja install
      sudo ldconfig

Build and run examples


git clone https://github.com/dinau/sdl3_nim
cd sdl3_nim
make 

or

pwd sdl3_nim
cd examples/basic
make run

alt

or

pwd 
sdl3_nim
cd examples/platformer
make run

alt

Develeopment


Generating SDL3 Nim header files with Futhark.

The definition file of SDL3 can be updated by yourself as follows,

  1. Replace src/private/SDL3 with latest officail SDL3 library

  2. Install Futhark

  3. Generate definition file

    pwd 
    sdl3_nim
    make gen

    src/sdl3_defs.nim updated will be generated.

My tools version


  • Futhark 0.15.0
  • nim-2.2.4
  • Gcc.exe (Rev2, Built by MSYS2 project) 15.1.0

Other SDL game tutorial platfromer project


ald

Language 1 SDL Project
LuaJIT Script SDL2 LuaJIT-Platformer
Nelua Compiler SDL2 NeLua-Platformer
Nim Compiler SDL3 / SDL2 Nim-Platformer-sdl2/ Nim-Platformer-sdl3
Ruby Script SDL3 Ruby-Platformer
Zig Compiler SDL2 Zig-Platformer

Other examples project for Dear ImGui


Language 1 Project
Lua Script LuaJITImGui
NeLua Compiler NeLuaImGui
Nim Compiler ImGuin, Nimgl_test, Nim_implot
Python Script DearPyGui for 32bit WindowsOS Binary
Ruby Script igRuby_Examples
Zig, C lang. Compiler Dear_Bindings_Build
Zig Compiler ImGuinZ

Footnotes

  1. Alphabectial order 2