Support right & middle mouse dragging, set macOS frameTimer based on vsync refresh period

This commit is contained in:
Stephen Saunders 2021-09-15 16:19:34 -04:00
parent 3941a5becd
commit 57e650b653
5 changed files with 49 additions and 8 deletions

View file

@ -11,15 +11,19 @@
#include "examples.h"
/*
void MVKExample::renderFrame() { // SRS - don't need to expose VulkanExampleBase::renderFrame() to DemoViewController
void MVKExample::renderFrame() { // SRS - don't need to expose VulkanExampleBase::renderFrame() to DemoViewController
_vulkanExample->renderFrame();
}
*/
void MVKExample::displayLinkOutputCb() { // SRS - expose VulkanExampleBase::displayLinkOutputCb() to DemoViewController
void MVKExample::displayLinkOutputCb() { // SRS - expose VulkanExampleBase::displayLinkOutputCb() to DemoViewController
_vulkanExample->displayLinkOutputCb();
}
void MVKExample::getRefreshPeriod(double refreshPeriod) { // SRS - get the actual refresh period of the display
_vulkanExample->refreshPeriod = refreshPeriod;
}
void MVKExample::windowWillResize(float x, float y) {
_vulkanExample->windowWillResize(x, y);
}
@ -85,14 +89,22 @@ void MVKExample::mouseUp(double x, double y) {
_vulkanExample->mouseButtons.left = false;
}
void MVKExample::otherMouseDown() {
void MVKExample::rightMouseDown() {
_vulkanExample->mouseButtons.right = true;
}
void MVKExample::otherMouseUp() {
void MVKExample::rightMouseUp() {
_vulkanExample->mouseButtons.right = false;
}
void MVKExample::otherMouseDown() {
_vulkanExample->mouseButtons.middle = true;
}
void MVKExample::otherMouseUp() {
_vulkanExample->mouseButtons.middle = false;
}
void MVKExample::mouseDragged(double x, double y) {
_vulkanExample->mouseDragged(x, y);
}
@ -109,7 +121,7 @@ MVKExample::MVKExample(void* view) {
_vulkanExample = new VulkanExample();
_vulkanExample->initVulkan();
_vulkanExample->setupWindow(view);
// _vulkanExample->initSwapchain(); // SRS - initSwapchain() is now part of VulkanExampleBase::prepare()
//_vulkanExample->initSwapchain(); // SRS - initSwapchain() is now part of VulkanExampleBase::prepare()
_vulkanExample->prepare();
}