Skip to content

Commit

Permalink
Removed viewChanged callback
Browse files Browse the repository at this point in the history
Preparation for reworking sync, such a callback would make it hard to find a proper sync point
SaschaWillems committed Jan 20, 2024
1 parent 5b8f093 commit d26aed2
Showing 2 changed files with 0 additions and 22 deletions.
20 changes: 0 additions & 20 deletions base/vulkanexamplebase.cpp
Original file line number Diff line number Diff line change
@@ -249,7 +249,6 @@ void VulkanExampleBase::nextFrame()
if (viewUpdated)
{
viewUpdated = false;
viewChanged();
}

render();
@@ -410,7 +409,6 @@ void VulkanExampleBase::renderLoop()
}
if (touchTimer >= 1.0) {
camera.keys.up = true;
viewChanged();
}

// Check gamepad state
@@ -436,18 +434,10 @@ void VulkanExampleBase::renderLoop()
camera.translate(glm::vec3(0.0f, 0.0f, gamePadState.axisRight.y * 0.01f));
updateView = true;
}
if (updateView)
{
viewChanged();
}
}
else
{
updateView = camera.updatePad(gamePadState.axisLeft, gamePadState.axisRight, frameTimer);
if (updateView)
{
viewChanged();
}
}
}
}
@@ -458,7 +448,6 @@ void VulkanExampleBase::renderLoop()
if (viewUpdated)
{
viewUpdated = false;
viewChanged();
}
render();
frameCounter++;
@@ -495,7 +484,6 @@ void VulkanExampleBase::renderLoop()
if (viewUpdated)
{
viewUpdated = false;
viewChanged();
}
DFBWindowEvent event;
while (!event_buffer->GetEvent(event_buffer, DFB_EVENT(&event)))
@@ -537,7 +525,6 @@ void VulkanExampleBase::renderLoop()
if (viewUpdated)
{
viewUpdated = false;
viewChanged();
}

while (!configured)
@@ -589,7 +576,6 @@ void VulkanExampleBase::renderLoop()
if (viewUpdated)
{
viewUpdated = false;
viewChanged();
}
xcb_generic_event_t *event;
while ((event = xcb_poll_for_event(connection)))
@@ -639,7 +625,6 @@ void VulkanExampleBase::renderLoop()
if (viewUpdated)
{
viewUpdated = false;
viewChanged();
}
render();
frameCounter++;
@@ -1472,8 +1457,6 @@ int32_t VulkanExampleBase::handleAppInput(struct android_app* app, AInputEvent*
vulkanExample->camera.rotate(glm::vec3(deltaX, 0.0f, 0.0f));
vulkanExample->camera.rotate(glm::vec3(0.0f, -deltaY, 0.0f));

vulkanExample->viewChanged();

vulkanExample->touchPos.x = eventX;
vulkanExample->touchPos.y = eventY;
}
@@ -2970,8 +2953,6 @@ void VulkanExampleBase::setupWindow()
}
#endif

void VulkanExampleBase::viewChanged() {}

void VulkanExampleBase::keyPressed(uint32_t) {}

void VulkanExampleBase::mouseMoved(double x, double y, bool & handled) {}
@@ -3193,7 +3174,6 @@ void VulkanExampleBase::windowResize()

// Notify derived class
windowResized();
viewChanged();

prepared = true;
}
2 changes: 0 additions & 2 deletions base/vulkanexamplebase.h
Original file line number Diff line number Diff line change
@@ -358,8 +358,6 @@ class VulkanExampleBase
virtual VkResult createInstance(bool enableValidation);
/** @brief (Pure virtual) Render function to be implemented by the sample application */
virtual void render() = 0;
/** @brief (Virtual) Called when the camera view has changed */
virtual void viewChanged();
/** @brief (Virtual) Called after a key was pressed, can be used to do custom key handling */
virtual void keyPressed(uint32_t);
/** @brief (Virtual) Called after the mouse cursor moved and before internal events (like camera rotation) is handled */

0 comments on commit d26aed2

Please sign in to comment.