Coder Social home page Coder Social logo

Comments (2)

emoose avatar emoose commented on June 25, 2024

It seems like most of that page is talking about what we'd already planned, creating a new interface when we're adding new functions and giving plugins a way to use the latest interface version with a typedef (seeing as plugin devs shouldn't really have to worry about interface versions and should just be able to use the latest), I added in the typedef (+ a define that refers to the latest version) in 57bb54b

Although they seem to take a step further by also creating new versions of the class as well as the interface, I'm not really sure if we'd need to do that unless there were some drastic changes seeing as the new functions in the class should get mapped to the vftable of the new interface, and the vftables of each interface would be put one after another in the classes actual vftable (ie latest version would be at the end, at least it has from what I've seen), letting us just cast the class between each interface version.
Maybe we'll have to do some further testing to make sure these interface vftables are being placed properly though.

Also while the way we do this is weird, I mostly copied this style of interfaces and the CreateInterface function from Valve, eg. see https://developer.valvesoftware.com/wiki/IGameConsole
The Steamworks SDK also uses the same interfaces system, and I haven't really seen many problems coming from it.

from dewrecode.

Ernegien avatar Ernegien commented on June 25, 2024

Yeah, typedefs alone help greatly with readability. As long as we're waterfalling changes to separate versioned interfaces we should be able to somewhat depend on vftable ordering (CTRL+F to "figure 3" in the article), although it appears to be borderline undefined behavior and subject to change. I obviously trust Valve's choices over my limited knowledge on the subject however :)

from dewrecode.

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.