IO: moved fields to put more focus on the new functions + update misc docs/references + update main.mm in Apple+Metal example (#4858)

This commit is contained in:
ocornut
2022-01-18 17:41:35 +01:00
parent 90a6961638
commit 673f5e588d
5 changed files with 46 additions and 37 deletions

View File

@ -238,7 +238,7 @@
UITouch *anyTouch = event.allTouches.anyObject;
CGPoint touchLocation = [anyTouch locationInView:self.view];
ImGuiIO &io = ImGui::GetIO();
io.MousePos = ImVec2(touchLocation.x, touchLocation.y);
io.AddMousePosEvent(touchLocation.x, touchLocation.y);
BOOL hasActiveTouch = NO;
for (UITouch *touch in event.allTouches)
@ -249,7 +249,7 @@
break;
}
}
io.MouseDown[0] = hasActiveTouch;
io.AddMouseButtonEvent(0, hasActiveTouch);
}
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event { [self updateIOWithTouchEvent:event]; }