Skip to content

archee565/sdl3_gs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sdl3_gs SDL3 wrapper by Gravitysensation

A safe Rust wrapper around SDL3's GPU API. Work in progress

Goal

sdl3_gs aims to provide an idiomatic, safe Rust interface over SDL3's low-level GPU API (SDL_GPU*). Rather than working directly with raw C pointers and unsafe FFI calls, users get:

  • RAII resource management — GPU resources (devices, textures, shaders, pipelines, buffers) are automatically cleaned up via Drop impls, preventing leaks.
  • Handle-based resource tracking — Resources are referenced through lightweight, copyable handles backed by a slot map, avoiding lifetime complexity while keeping safety.
  • Safe public API — All unsafe SDL3 calls are encapsulated internally; the public surface is safe Rust.
  • Thin abstraction — The wrapper stays close to SDL3's GPU API design, making it easy to follow SDL3 documentation and examples while writing Rust.

The crate builds on sdl3-sys (v0.6.1, targeting SDL 3.4.2) for raw FFI bindings.

Status

Early stage. The wrapper currently covers:

  • Device creation and window claiming
  • Texture, shader, buffer, and graphics pipeline management
  • Command buffer recording with render passes and copy passes
  • Swapchain texture acquisition
  • Vertex/index buffer uploads via internal transfer buffers

Usage

Add to your Cargo.toml:

[dependencies]
sdl3_gs = { git = "https://github.com/archee565/sdl3_gs.git" }

License

MIT

About

Safe Rust wrapper around SDL3's GPU API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages