Perl-GPU / OpenGL-Modern

Perl OpenGL bindings for modern OpenGL 3.1-4.x
7 stars 5 forks source link

hack module to allow OpenGL::Image to seamlessly use OpenGL::Modern #54

Closed wchristian closed 7 years ago

wchristian commented 7 years ago

I mentioned this yesterday and here it is. It is exceedingly simple.

It sets up a fake OpenGL namespace and blocks the %INC entry so it won't be overloaded by the real OpenGL.pm. Then it installs a barebones import method that simply rewrites it into an import on OpenGL::Modern, executed in the namespace of the caller. That way any import calls to the OpenGL namespace result in the import being done from OpenGL::Modern into the caller.

Only niggle is that OpenGL::Modern has no :constants, so i had to munge that into :all.

What do you think?

devel-chm commented 7 years ago

Seems reasonable. Maybe it make sense to add :constants to OpenGL::Modern?

wchristian commented 7 years ago

For backwards compatibility, absolutely.