Code Monkey home page Code Monkey logo

Comments (3)

brson avatar brson commented on August 17, 2024

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.

AngryLawyer avatar AngryLawyer commented on August 17, 2024

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.

brson avatar brson commented on August 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.