Skip to content
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

Namespaces and enums #52

Open
1 of 2 tasks
electronstudio opened this issue Nov 17, 2021 · 2 comments
Open
1 of 2 tasks

Namespaces and enums #52

electronstudio opened this issue Nov 17, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@electronstudio
Copy link
Owner

electronstudio commented Nov 17, 2021

  • enums

Currently the docs list enums, but they don’t actually exist as objects - cffi just converts all the values to ints.

So first we need to fix the docs.

Then, is there an automated way we could make real enums? Or just put the ints into appropriate namespaces so they are grouped appropriately together in the docs?

  • separating raygui etc into a different namespace would also be nice, but I’m not sure how since the original C puts all the functions into the same global namespace.
@Yu-Vitaqua-fer-Chronos
Copy link

Yu-Vitaqua-fer-Chronos commented Feb 3, 2022

Python has the Enum module which may be useful? Exec is usually discouraged but in certain scenarios it's fine, as this isn't running untrusted code. And recently Raylib released an official way to make automated bindings which could potentially help? If using the automated bindings, using SimpleNamespace could also help you collect the modules together

@electronstudio
Copy link
Owner Author

You mean https://github.com/raysan5/raylib/blob/master/parser/raylib_api.json ? We already use that to generate the .pyi hints. So yes you're right we could use it to generate enums.

electronstudio added a commit that referenced this issue Feb 4, 2022
…ay itself for backwards compability) add proper enums to pyray and to pyray hints/docs (generated from raylib.json). TODO: raygui, rlgl, maybe something for the C API. See issue #52
electronstudio added a commit that referenced this issue Feb 7, 2022
@electronstudio electronstudio added the enhancement New feature or request label Jun 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants