Cleaning up window delegate

This commit is contained in:
Alexander Bock
2020-05-10 15:17:51 +02:00
parent 1b60ab1038
commit 3b427bfd15
9 changed files with 27 additions and 144 deletions
-80
View File
@@ -884,15 +884,6 @@ void setSgctDelegateFunctions() {
sgct::ClusterManager::instance().setUseIgnoreSync(enabled);
};
sgctDelegate.clearAllWindows = [](const glm::vec4& clearColor) {
ZoneScoped
for (const std::unique_ptr<Window>& window : Engine::instance().windows()) {
glClearColor(clearColor.r, clearColor.g, clearColor.b, clearColor.a);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glfwSwapBuffers(window->windowHandle());
}
};
sgctDelegate.windowHasResized = []() {
ZoneScoped
@@ -925,26 +916,6 @@ void setSgctDelegateFunctions() {
return sgct::Engine::getTime();
};
sgctDelegate.mousePosition = []() {
ZoneScoped
double xPos;
double yPos;
glfwGetCursorPos(currentWindow->windowHandle(), &xPos, &yPos);
return glm::vec2(xPos, yPos);
};
sgctDelegate.mouseButtons = [](int maxNumber) {
ZoneScoped
uint32_t result = 0;
for (int i = 0; i < maxNumber; ++i) {
bool button = (glfwGetMouseButton(currentWindow->windowHandle(), i) != 0);
if (button) {
result |= (1 << i);
}
}
return result;
};
sgctDelegate.currentWindowSize = []() {
ZoneScoped
@@ -980,12 +951,6 @@ void setSgctDelegateFunctions() {
);
}
};
sgctDelegate.currentWindowResolution = []() {
ZoneScoped
ivec2 dim = currentWindow->finalFBODimensions();
return glm::ivec2(dim.x, dim.y);
};
sgctDelegate.currentDrawBufferResolution = []() {
ZoneScoped
@@ -1023,11 +988,6 @@ void setSgctDelegateFunctions() {
vec2 scale = currentWindow->scale();
return glm::vec2(scale.x, scale.y);
};
sgctDelegate.currentNumberOfAaSamples = []() {
ZoneScoped
return currentWindow->numberOfAASamples();
};
sgctDelegate.hasGuiWindow = []() {
ZoneScoped
@@ -1048,21 +1008,6 @@ void setSgctDelegateFunctions() {
return Engine::instance().isMaster();
};
sgctDelegate.isUsingSwapGroups = []() {
ZoneScoped
return Window::isUsingSwapGroups();
};
sgctDelegate.isSwapGroupMaster = []() {
ZoneScoped
return Window::isSwapGroupMaster();
};
sgctDelegate.viewProjectionMatrix = []() {
ZoneScoped
return currentModelViewProjectionMatrix;
};
sgctDelegate.modelMatrix = []() {
ZoneScoped
@@ -1073,31 +1018,6 @@ void setSgctDelegateFunctions() {
Engine::instance().setNearAndFarClippingPlanes(nearPlane, farPlane);
};
sgctDelegate.setEyeSeparationDistance = [](float distance) {
ZoneScoped
Engine::instance().setEyeSeparation(distance);
};
//sgctDelegate.viewportPixelCoordinates = []() {
// ZoneScoped
// if (!currentWindow|| !currentViewport) {
// return glm::ivec4(0);
// }
// else {
// const int* data = cur sgct::Engine::instance()->getCurrentViewportPixelCoords();
// return glm::ivec4(data[0], data[2], data[1], data[3]);
// }
//};
//sgctDelegate.sendMessageToExternalControl = [](const std::vector<char>& message) {
// ZoneScoped
//
// sgct::Engine::instance()->sendMessageToExternalControl(
// message.data(),
// static_cast<int>(message.size())
// );
//};
sgctDelegate.isFisheyeRendering = []() {
ZoneScoped