-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rescope raylib.h into raylib::impl namespace #45
Comments
Mind submitting a PR as a demonstration of what you're suggesting? Seems like a neat idea. |
Please see #46. A quick example showing what I mean. As I mention in the pr, its really a matter of design preference. Ultimately what I would personally like to see is a complete c++ wrapper around the c functionality so that it can be fully object-oriented. If that is not how you guys want to handle it, totally understand and I am more than happy to work with it as is. |
Some concerns I have with rescoping the C library....
We could introduce a |
So ... why not putting the cpp version into its own namespace then? That would at least make the --allow-multiple-definition flag obsolete. And I consider it as pretty dangerous to be active in my projects.. |
To avoid conflicts. When you use...
Are using raylib's There are the shorthand aliases available, however...
... etc. |
Currently, the following code is included outside of namespace raylib, which pollutes the global namespace with raylib functions and types which can occasionally cause collisions. Is it possible to move this include into the raylib namespace? Many of the scope operators will have to be adjusted but I think this might result in some cleaner code. Also, I believe that the __cplusplus guards are not necessary when directly including a c header. I think this is typically used around C code that can be compiled by both a c & c++ compiler. The extern "C" is definitely still necessary though. Apologies if I am missing something.
https://isocpp.org/wiki/faq/mixing-c-and-cpp#include-c-hdrs-system
Edit: extern "C" guards are in raylib.h already. It does not appear that it is necessary to include it in raylib-cpp
The text was updated successfully, but these errors were encountered: