Code Monkey home page Code Monkey logo

Comments (4)

utkumaden avatar utkumaden commented on June 11, 2024

The OpenTK3 generator (which OpenTK4 uses) was written when there was no in parameters in C#. Currently there are no plans to update this generator any further. I believe OpenTK5 generators generate not only span overloads but also in parameters.

from opentk.

caverna avatar caverna commented on June 11, 2024

understood, just in case anyone steps on this same situation, this workaroud does the trick:

fixed (float* tmp = &value.X)
{
GL.Uniform3(location, 1, ref *tmp);
}

the only draw back is that you have to set your project as "unsafe"

from opentk.

NogginBops avatar NogginBops commented on June 11, 2024

You should also be able to use Unsafe.AsRef<T>(in value) to get a ref in a simpler way, though it might be worth thinking if its appropriate as you are no longer pinning the object (which may or may not be necessary).

from opentk.

NogginBops avatar NogginBops commented on June 11, 2024

Closing this issue. In the new bindings generator for OpenTK 5 we do generate ref vs in parameters where appropriate. So with the workaround and the new bindings generator this should not longer be a problem.

from opentk.

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.