MCPcopy Index your code
hub / github.com/brson/rust-sdl

github.com/brson/rust-sdl @0.8

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.8 ↗ · + Follow
231 symbols 313 edges 14 files 1 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Rust-SDL

Bindings for SDL in Rust

Overview

Rust-SDL is a library for talking to SDL from Rust. Low-level C components are wrapped in Rust code to make them more idiomatic and abstract away inappropriate manual memory management.

In addition, it provides optional APIs to a number of common SDL extension libraries.

Rust-SDL uses the MIT license.

Requirements

  • Rust - we currently compile against the Master branch. The releases on http://www.rust-lang.org tend to not work.
  • SDL 1.2 development libraries - install through your favourite package management tool, or via http://www.libsdl.org/

Optional * SDL_Mixer and SDL_Image - also available through most package managers, or through http://www.libsdl.org/projects/SDL_mixer/ and http://www.libsdl.org/projects/SDL_image/

Installation

Clone this repo, run ./configure, and then make. To see an example of the code in use, make demos. If you don't want SDL_Mixer (if you aren't using sound) or SDL_Image (if you're not using image formats other than BMP) then you can exclude them from make by setting RUSTFLAGS. For example, if you wish to use just SDL_Image, RUSTFLAGS="--cfg image" make

Demo

To compile the demo:

rustc -L$PWD demo/demo.rc

Then run:

./demo/demo

When things go wrong

Rust, and Rust-SDL, are both still heavily in development, and you may run into teething issues when using this. Before panicking, check that you're using the latest Master branch of Rust, check that you've updated Rust-SDL to the latest version, and run make clean and ./configure. If that fails, please let us know on the issue tracker.

Core symbols most depended-on inside this repo

get_error
called by 11
src/sdl.rs
wrap_surface
called by 6
src/video.rs
to_struct
called by 3
src/video.rs
to_ll_format
called by 2
src/audio.rs
count
called by 2
src/audio.rs
check_if_not_playing
called by 2
src/mixer.rs
to_ll_chunk
called by 2
src/mixer.rs
to_mapped
called by 2
src/video.rs

Shape

Function 86
Method 83
Class 38
Enum 24

Languages

Rust100%

Modules by API surface

src/event.rs65 symbols
src/video.rs64 symbols
src/mixer.rs19 symbols
src/joy.rs17 symbols
src/audio.rs17 symbols
src/sdl.rs15 symbols
src/cd.rs15 symbols
src/wm.rs9 symbols
src/img.rs4 symbols
src/gl.rs3 symbols
src/start.rs2 symbols
demo/video.rs1 symbols

For agents

$ claude mcp add rust-sdl \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact