Comments (3)
My general strategy for creating bindings these days is to create a set of low-level bindings (usually in a ll
) module that maps directly to the native API, then high level bindings that encapsulate the low-level bindings into safe Rust, often following Rust naming conventions. The exact strategy for high-level bindings tends to depend on the native library, but ideally the library is object ordiented and has a reasonable memory-management strategy. In that case structs + dtors + impls tend to work very well.
Adding high-level SDL bindings would be a fine thing.
FWIW, these bindings were initially created a long time ago and I recall them being sort of awkward. There may be better ways to organize them, and I encourage you to make any modifications that you need.
from rust-sdl.
Sounds like a good way of tackling it. I'll take a peek at some of your other projects to make sure I'm going the right way, and I'll tackle this in the coming weeks.
from rust-sdl.
The servo bindings tend to reflect my current thinking about bindings: https://github.com/mozilla-servo/
The one I'm working on now is https://github.com/mozilla-servo/rust-netsurfcss
from rust-sdl.
Related Issues (20)
- Issue running the demo app HOT 2
- Enum size optimizations break transmutes HOT 1
- Rust has removed fixed_stack_segment, and externfn! HOT 1
- Issue running demo app in OSX 10.9 Mavericks HOT 2
- No binding for SDL_Delay HOT 2
- Linking sdl-demo/sdl_main.rs fails HOT 1
- Rust runtime error when using audio callback and Arc<RWLock>> HOT 1
- Shipping rust-sdl on cargo HOT 1
- nevermind
- Usage of deprecated std::num::FromPrimitive HOT 1
- Upload 0.3.6 to cargo.io HOT 5
- provide `Debug` and `PartialEq` HOT 1
- PlatformThread spawn mode removed HOT 4
- A binding to SDL_PushEvent is needed HOT 1
- Migrate to SDL2? HOT 6
- rustc update fixes - cstr & scope HOT 1
- Demo still uses `sdl::start` HOT 5
- doesn't link on ubuntu 12, cc: error: Foundation: No such file or directory HOT 1
- OSX linking error when making demo: "Undefined symbol __SDL_main "
- src/video.rs:5:4: 5:22 error: unresolved import: there is no `RngUtil` in `std::rand` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust-sdl.