Skip to content

Conversation

@codecat
Copy link
Contributor

@codecat codecat commented Jul 7, 2018

Fixes this warning:

imgui.h(132): warning C4244: 'argument': conversion from 'const float' to 'int', possible loss of data imgui-sfml.cpp(338): note: see reference to function template instantiation 'ImVec2::operator sf::Vector2<int>(void) const<int>' being compiled 
Copy link
Member

@eXpl0it3r eXpl0it3r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use C++' static_cast<>.

Alternative method for converting would be to construct an sf::Vector2f abd pass that to the constructor, then SFML will do the cast.

@codecat
Copy link
Contributor Author

codecat commented Jul 10, 2018

The mousePos vector is an ImVec2, does imgui-sfml provide an automatic cast for that?

@eliasdaler eliasdaler merged commit 7263b21 into SFML:master Jul 16, 2018
@eliasdaler
Copy link
Contributor

Looks good, thanks!

I should probably re-check all ImVec2 <-> sf::Vector2 conversions and not rely on implicit casts at all in ImGui-SFML's code...

@codecat codecat deleted the fix-cast branch July 16, 2018 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants