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

Random Number Generator does not work #52

Open
marcoperic opened this issue Mar 3, 2022 · 4 comments
Open

Random Number Generator does not work #52

marcoperic opened this issue Mar 3, 2022 · 4 comments

Comments

@marcoperic
Copy link

marcoperic commented Mar 3, 2022

Hi

It seems like RNG<> does not generate random numbers in succession. Even after restarting my instance, I still get the same number.

@johnBuffer
Copy link
Owner

Thank you for the report, I will look into this

@johnBuffer
Copy link
Owner

Can you provide a minimal code showing how you are using it ?

@marcoperic
Copy link
Author

marcoperic commented Mar 3, 2022

Can you provide a minimal code showing how you are using it ?

I borrowed some of your code from the color_picker.hpp class and got similar results.
RNGf::getUnder(255.0f) , after running in main() as a test, returned the same value across different instances, 192.88.
I am accessing RNG<> via #include "common/number_generator.hpp"

Edit:
I just saw that you called RNG::initialize() in main()... I never did this. Would this be the cause of my problem?

Regards,
Marco

@johnBuffer
Copy link
Owner

This initialize is a new addition to ensure that the static attribute of the RNG object is correctly created before any use but I am not sure this will solve the issue you have. I will do some tests this afternoon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants