You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
See the recent post to the POGL developers list for the initial discussion. The idea is that rather than 1-off implementations of OpenGL bindings for each type of possible array/pointer-ish object (OpenGL::Array, PDL, ...) we would implement a role to implement and require the needed functionality.
The implementation for an argument would then be something like this:
subglRoutine ($data_arg) {
die"No bindings for data arg"unless$data_arg->does(OpenGL::Modern::Role::DataArg);
# now we can use the role to implement the bindings
&glRoutine_xs($data_arg->size,,$data_arg->ptr);
}
The text was updated successfully, but these errors were encountered:
My summary of that discussion: some sort of polymorphism where a "class" of using code knows how to unwrap its data for OpenGL use, with an interface role providing the cue that that using code can do so.
My feeling is that there may be some value to this, but an alternative is for this distro to provide facilities for other Perl code to make their own bindings into OpenGL, by making available:
paths (like an Alien module)
lists of OpenGL extensions / functions / signatures
maybe utility functions to help generate XS code suitable for each using code's needs
This is effectively the approach taken by the PDL bindings, which knows much better how to scale up OpenGL stuff (using broadcasting) than a thing done once per small-scale "thing" (single Perl array/vector). The way forward would be to let a hundred flowers bloom, and then identify what they have in common. Having worked with the PDL POGL bindings, and created a PDL OpenCV binding, my suspicion is that what will be in common will most usefully be the above.
With that in mind, this issue is too vague to really be actionable, but the link to the discussion is useful, so it should stay open for now.
mohawk2
changed the title
use roles to implement bindings to pointer args
Support various ways for Perl code to use OpenGL (C pointers, packed strings, ndarrays, etc)
Sep 16, 2024
See the recent post to the POGL developers list for the initial discussion. The idea is that rather than 1-off implementations of OpenGL bindings for each type of possible array/pointer-ish object (OpenGL::Array, PDL, ...) we would implement a role to implement and require the needed functionality.
The implementation for an argument would then be something like this:
The text was updated successfully, but these errors were encountered: