Set viewUpdated=true for macOS scroll wheel, open vulkanExamples window in front of Xcode, accept mouse click-through on macOS
This commit is contained in:
parent
8bc8d14cf2
commit
a184bd7007
3 changed files with 10 additions and 1 deletions
|
|
@ -1549,6 +1549,8 @@ dispatch_group_t concurrentGroup;
|
||||||
|
|
||||||
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
|
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification
|
||||||
{
|
{
|
||||||
|
[NSApp activateIgnoringOtherApps:YES]; // SRS - Make sure app window launches in front of Xcode window
|
||||||
|
|
||||||
concurrentGroup = dispatch_group_create();
|
concurrentGroup = dispatch_group_create();
|
||||||
dispatch_queue_t concurrentQueue = dispatch_get_global_queue(QOS_CLASS_USER_INTERACTIVE, 0);
|
dispatch_queue_t concurrentQueue = dispatch_get_global_queue(QOS_CLASS_USER_INTERACTIVE, 0);
|
||||||
dispatch_group_async(concurrentGroup, concurrentQueue, ^{
|
dispatch_group_async(concurrentGroup, concurrentQueue, ^{
|
||||||
|
|
@ -1628,6 +1630,11 @@ static CVReturn displayLinkOutputCallback(CVDisplayLinkRef displayLink, const CV
|
||||||
return YES;
|
return YES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL)acceptsFirstMouse:(NSEvent *)event
|
||||||
|
{
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
- (void)keyDown:(NSEvent*)event
|
- (void)keyDown:(NSEvent*)event
|
||||||
{
|
{
|
||||||
switch (event.keyCode)
|
switch (event.keyCode)
|
||||||
|
|
@ -1751,6 +1758,7 @@ static CVReturn displayLinkOutputCallback(CVDisplayLinkRef displayLink, const CV
|
||||||
short wheelDelta = [event deltaY];
|
short wheelDelta = [event deltaY];
|
||||||
vulkanExample->camera.translate(glm::vec3(0.0f, 0.0f,
|
vulkanExample->camera.translate(glm::vec3(0.0f, 0.0f,
|
||||||
-(float)wheelDelta * 0.05f * vulkanExample->camera.movementSpeed));
|
-(float)wheelDelta * 0.05f * vulkanExample->camera.movementSpeed));
|
||||||
|
vulkanExample->viewUpdated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// SRS - Window resizing already handled by windowResize() in VulkanExampleBase::submitFrame()
|
// SRS - Window resizing already handled by windowResize() in VulkanExampleBase::submitFrame()
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,6 @@ class VulkanExampleBase
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
std::string getWindowTitle();
|
std::string getWindowTitle();
|
||||||
bool viewUpdated = false;
|
|
||||||
uint32_t destWidth;
|
uint32_t destWidth;
|
||||||
uint32_t destHeight;
|
uint32_t destHeight;
|
||||||
bool resizing = false;
|
bool resizing = false;
|
||||||
|
|
@ -177,6 +176,7 @@ protected:
|
||||||
public:
|
public:
|
||||||
bool prepared = false;
|
bool prepared = false;
|
||||||
bool resized = false;
|
bool resized = false;
|
||||||
|
bool viewUpdated = false;
|
||||||
uint32_t width = 1280;
|
uint32_t width = 1280;
|
||||||
uint32_t height = 720;
|
uint32_t height = 720;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -107,6 +107,7 @@ void MVKExample::mouseDragged(double x, double y) {
|
||||||
|
|
||||||
void MVKExample::scrollWheel(short wheelDelta) {
|
void MVKExample::scrollWheel(short wheelDelta) {
|
||||||
_vulkanExample->camera.translate(glm::vec3(0.0f, 0.0f, wheelDelta * 0.05f * _vulkanExample->camera.movementSpeed));
|
_vulkanExample->camera.translate(glm::vec3(0.0f, 0.0f, wheelDelta * 0.05f * _vulkanExample->camera.movementSpeed));
|
||||||
|
_vulkanExample->viewUpdated = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MVKExample::fullScreen(bool fullscreen) {
|
void MVKExample::fullScreen(bool fullscreen) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue