Closed Pulfer closed 5 years ago
Two functions are missing from src/platform_linux.cc
as shown below:
v2i
platform_cursor_get_position(PlatformState* platform)
{
v2i pos;
SDL_GetMouseState(&pos.x, &pos.y);
return pos;
}
void
platform_cursor_set_position(PlatformState* platform, v2i pos)
{
SDL_WarpMouseInWindow(platform->window, pos.x, pos.y);
// Pending mouse move events will have the cursor close
// to where it was before we set it.
SDL_FlushEvent(SDL_MOUSEMOTION);
SDL_FlushEvent(SDL_SYSWMEVENT);
}
Tested under FreeBSD, seems to DTRT.
Thanks for the bug report and fixes!
CMakeFiles/Milton.dir/src/unity.cc.o: In function
drag_brush_size_start(Milton*, Vector2<int>)': unity.cc:(.text+0x25512): undefined reference to
platform_cursor_get_position' CMakeFiles/Milton.dir/src/unity.cc.o: In functiondrag_brush_size_stop(Milton*)': unity.cc:(.text+0x25623): undefined reference to
platform_cursor_set_position' CMakeFiles/Milton.dir/src/unity.cc.o: In functionbinding_dispatch_action(BindableAction, MiltonInput*, Milton*, Vector2<int>)': unity.cc:(.text+0x5d8a4): undefined reference to
platform_cursor_set_position' CMakeFiles/Milton.dir/src/unity.cc.o: In functionmilton_update_and_render(Milton*, MiltonInput const*)': unity.cc:(.text+0x686cb): undefined reference to
platform_cursor_get_position'These functions are defined for Mac and Windows but not for Linux (platform_linux.cc).