Skip to content

Commit cdf8a7e

Browse files
committed
Reduce scope of function
1 parent 7b6db48 commit cdf8a7e

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

imgui-SFML.cpp

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,6 @@ void setClipboardText(void* /*userData*/, const char* text)
215215
}
216216

217217
// mouse cursors
218-
void loadMouseCursor(ImGuiMouseCursor imguiCursorType, sf::Cursor::Type sfmlCursorType);
219218
void updateMouseCursor(sf::Window& window);
220219

221220
// Key mappings
@@ -327,6 +326,8 @@ bool Init(sf::Window& window, const sf::Vector2f& displaySize, bool loadDefaultF
327326
io.GetClipboardTextFn = getClipboardText;
328327

329328
// load mouse cursors
329+
const auto loadMouseCursor = [](ImGuiMouseCursor imguiCursorType, sf::Cursor::Type sfmlCursorType)
330+
{ s_currWindowCtx->mouseCursors[imguiCursorType] = sf::Cursor::createFromSystem(sfmlCursorType); };
330331
loadMouseCursor(ImGuiMouseCursor_Arrow, sf::Cursor::Type::Arrow);
331332
loadMouseCursor(ImGuiMouseCursor_TextInput, sf::Cursor::Type::Text);
332333
loadMouseCursor(ImGuiMouseCursor_ResizeAll, sf::Cursor::Type::SizeAll);
@@ -1239,11 +1240,6 @@ void updateJoystickAxisState(ImGuiIO& io)
12391240
false);
12401241
}
12411242

1242-
void loadMouseCursor(ImGuiMouseCursor imguiCursorType, sf::Cursor::Type sfmlCursorType)
1243-
{
1244-
s_currWindowCtx->mouseCursors[imguiCursorType] = sf::Cursor::createFromSystem(sfmlCursorType);
1245-
}
1246-
12471243
void updateMouseCursor(sf::Window& window)
12481244
{
12491245
const ImGuiIO& io = ImGui::GetIO();

0 commit comments

Comments
 (0)