#How to wrap while having same type

2 messages · Page 1 of 1 (latest)

misty scarab
#

So I want to wrap an incoming type from a C library while keeping it the same type without polluting the whole namespace.

I have Texture struct coming in from <raylib> (the C library), but as its C lib, it bring everything into global namespace.

I want to use only the Texture struct elsewhere in my codebase, preferably directly, like myDrawMethod(Texture tex)

how could I approach that ?
One idea that came into mind was pimpl with typecasting pointers but that loses the original type.

analog yarrowBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.