SaschaWillems / Vulkan-glTF-PBR

Physical based rendering with Vulkan using glTF 2.0 models
MIT License
913 stars 123 forks source link

GUI non-functional on macOS 12.7.4 #81

Open rgosens2 opened 3 weeks ago

rgosens2 commented 3 weeks ago

Builds but Imgui not working.

SaschaWillems commented 3 weeks ago

I don't own any Apple device and as such can't support them. If this needs fixing, feel free to provide a PR.

rgosens2 commented 3 weeks ago

Mouse y coordinate is reversed (moving mouse down moves pointer up in imgui). I'll look into it. Mouse works fine in your Vulkan repo. Good examples. Thanks.

rgosens2 commented 3 weeks ago

In base/VulkanExampleBase.cpp add:

- (NSPoint)getMouseLocalPoint:(NSEvent*)event
{
    NSPoint location = [event locationInWindow];
    NSPoint point = [self convertPoint:location fromView:nil];
    point.y = self.frame.size.height - point.y;
    return point;
}

And change:

NSPoint point = [self convertPoint:location fromView:nil];

to:

auto point = [self getMouseLocalPoint:event];

(Same as in your Vulkan repo where mouse works OK)