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

Recommendations for code changes #46

Open
wystewart opened this issue May 9, 2024 · 2 comments
Open

Recommendations for code changes #46

wystewart opened this issue May 9, 2024 · 2 comments
Labels
progress: waiting for confirmation and close Waiting for confirmation and close

Comments

@wystewart
Copy link

Some global variables in the code many affect having multiple instances of the fontrender.
in my copy I moved
FT_Library g_FtLibrary;
bool g_NeedInitialize
from OpenFontRenderer.cpp into the the private section of the class OpenFontRender in the .h file.

I did not check if any of the underlying code has globals.

@takkaO
Copy link
Owner

takkaO commented May 9, 2024

@wystewart

Some global variables in the code many affect having multiple instances of the fontrender.

Can you explain in detail how this will affect?

If I understand correctly, FT_Library does not need to be independent in each instance.
If the problem is that global variables are ugly, redefining them as class variables (static members) might be a good idea.

@wystewart
Copy link
Author

Ok, I assumed that FT_Lbrary needed to be independent for each instance and since g_NeedInitialize is protecting FT_Lbrary the same could be said for that too. I'll do some tests when I have a chance.

@takkaO takkaO added the progress: waiting for confirmation and close Waiting for confirmation and close label May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
progress: waiting for confirmation and close Waiting for confirmation and close
Projects
None yet
Development

No branches or pull requests

2 participants