@@ -118,11 +118,11 @@ static_assert(sizeof(GLuint) <= sizeof(ImTextureID), "ImTextureID is not large e
118
118
namespace
119
119
{
120
120
// 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);
126
126
127
127
struct SpriteTextureData
128
128
{
@@ -131,35 +131,35 @@ struct SpriteTextureData
131
131
ImTextureID textureID{};
132
132
};
133
133
134
- SpriteTextureData getSpriteTextureData (const sf::Sprite& sprite);
134
+ [[nodiscard]] SpriteTextureData getSpriteTextureData (const sf::Sprite& sprite);
135
135
136
- ImTextureID convertGLTextureHandleToImTextureID (GLuint glTextureHandle);
137
- GLuint convertImTextureIDToGLTextureHandle (ImTextureID textureID);
136
+ [[nodiscard]] ImTextureID convertGLTextureHandleToImTextureID (GLuint glTextureHandle);
137
+ [[nodiscard]] GLuint convertImTextureIDToGLTextureHandle (ImTextureID textureID);
138
138
139
139
void RenderDrawLists (ImDrawData* draw_data); // rendering callback function prototype
140
140
141
141
// Default mapping is XInput gamepad mapping
142
142
void initDefaultJoystickMapping ();
143
143
144
144
// Returns first id of connected joystick
145
- unsigned int getConnectedJoystickId ();
145
+ [[nodiscard]] unsigned int getConnectedJoystickId ();
146
146
147
147
void updateJoystickButtonState (ImGuiIO& io);
148
148
void updateJoystickDPadState (ImGuiIO& io);
149
149
void updateJoystickAxisState (ImGuiIO& io);
150
150
151
151
// 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;
155
155
156
156
// mouse cursors
157
157
void loadMouseCursor (ImGuiMouseCursor imguiCursorType, sf::Cursor::Type sfmlCursorType);
158
158
void updateMouseCursor (sf::Window& window);
159
159
160
160
// 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);
163
163
164
164
// data
165
165
constexpr unsigned int NULL_JOYSTICK_ID = sf::Joystick::Count;
0 commit comments