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

imgui_freetype: fix nullptr to ImTextureID cast #7192

Merged
merged 1 commit into from
Jan 3, 2024

Conversation

pthom
Copy link
Contributor

@pthom pthom commented Jan 3, 2024

This is a small fix for some systems where casting from void* to ImTextureID needs to be done in two steps:

On macOS, we get an error saying:

error: cast from pointer to smaller type 'int' loses information
atlas->TexID = (ImTextureID)nullptr;

@ocornut
Copy link
Owner

ocornut commented Jan 3, 2024

We should use a direct TexID = 0 here as in other places of the code, nullptr is misleading anyway.

On macOS, we get an error saying:

error: cast from pointer to smaller type 'int' loses information
    atlas->TexID = (ImTextureID)nullptr;
@pthom
Copy link
Contributor Author

pthom commented Jan 3, 2024

We should use a direct TexID = 0 here as in other places of the code, nullptr is misleading anyway.

OK. I force-pushed a corrected version

@ocornut ocornut merged commit 4758f74 into ocornut:master Jan 3, 2024
6 checks passed
@pthom pthom deleted the patch-1 branch January 3, 2024 23:54
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

Successfully merging this pull request may close these issues.

2 participants