@@ -118,11 +118,11 @@ static_assert(sizeof(GLuint) <= sizeof(ImTextureID), "ImTextureID is not large e
118118namespace
119119{
120120// various helper functions
121- ImColor toImColor (sf::Color c);
122- ImVec2 toImVec2 (const sf::Vector2f& v);
123- sf::Vector2f toSfVector2f (const ImVec2& v);
124- ImVec2 getTopLeftAbsolute (const sf::FloatRect& rect);
125- ImVec2 getDownRightAbsolute (const sf::FloatRect& rect);
121+ [[nodiscard]] ImColor toImColor (sf::Color c);
122+ [[nodiscard]] ImVec2 toImVec2 (const sf::Vector2f& v);
123+ [[nodiscard]] sf::Vector2f toSfVector2f (const ImVec2& v);
124+ [[nodiscard]] ImVec2 getTopLeftAbsolute (const sf::FloatRect& rect);
125+ [[nodiscard]] ImVec2 getDownRightAbsolute (const sf::FloatRect& rect);
126126
127127struct SpriteTextureData
128128{
@@ -131,35 +131,35 @@ struct SpriteTextureData
131131 ImTextureID textureID{};
132132};
133133
134- SpriteTextureData getSpriteTextureData (const sf::Sprite& sprite);
134+ [[nodiscard]] SpriteTextureData getSpriteTextureData (const sf::Sprite& sprite);
135135
136- ImTextureID convertGLTextureHandleToImTextureID (GLuint glTextureHandle);
137- GLuint convertImTextureIDToGLTextureHandle (ImTextureID textureID);
136+ [[nodiscard]] ImTextureID convertGLTextureHandleToImTextureID (GLuint glTextureHandle);
137+ [[nodiscard]] GLuint convertImTextureIDToGLTextureHandle (ImTextureID textureID);
138138
139139void RenderDrawLists (ImDrawData* draw_data); // rendering callback function prototype
140140
141141// Default mapping is XInput gamepad mapping
142142void initDefaultJoystickMapping ();
143143
144144// Returns first id of connected joystick
145- unsigned int getConnectedJoystickId ();
145+ [[nodiscard]] unsigned int getConnectedJoystickId ();
146146
147147void updateJoystickButtonState (ImGuiIO& io);
148148void updateJoystickDPadState (ImGuiIO& io);
149149void updateJoystickAxisState (ImGuiIO& io);
150150
151151// clipboard functions
152- void setClipboardText (void * userData, const char * text);
153- const char * getClipboardText (void * userData);
154- std::string s_clipboardText;
152+ void setClipboardText (void * userData, const char * text);
153+ [[nodiscard]] const char * getClipboardText (void * userData);
154+ std::string s_clipboardText;
155155
156156// mouse cursors
157157void loadMouseCursor (ImGuiMouseCursor imguiCursorType, sf::Cursor::Type sfmlCursorType);
158158void updateMouseCursor (sf::Window& window);
159159
160160// Key mappings
161- ImGuiKey keycodeToImGuiKey (sf::Keyboard::Key code);
162- ImGuiKey keycodeToImGuiMod (sf::Keyboard::Key code);
161+ [[nodiscard]] ImGuiKey keycodeToImGuiKey (sf::Keyboard::Key code);
162+ [[nodiscard]] ImGuiKey keycodeToImGuiMod (sf::Keyboard::Key code);
163163
164164// data
165165constexpr unsigned int NULL_JOYSTICK_ID = sf::Joystick::Count;
0 commit comments