Added new method to get the right viewport size in stereo (side-by-side) and fix font rendering.

This commit is contained in:
Jonathas Costa
2018-04-20 11:22:23 -04:00
parent 1e0d41fb30
commit 5079beba78
6 changed files with 44 additions and 18 deletions

View File

@@ -170,6 +170,17 @@ glm::ivec2 SGCTWindowWrapper::currentDrawBufferResolution() const {
throw WindowWrapperException("No viewport available");
}
glm::ivec2 SGCTWindowWrapper::getCurrentViewportSize() const {
sgct_core::Viewport* viewport =
sgct::Engine::instance()->getCurrentWindowPtr()->getViewport(0);
if (viewport != nullptr) {
int xx = 0, yy = 0;
sgct::Engine::instance()->getCurrentViewportSize(xx, yy);
return glm::ivec2(xx, yy);
}
throw WindowWrapperException("No viewport available");
}
glm::vec2 SGCTWindowWrapper::dpiScaling() const {
return glm::vec2(
sgct::Engine::instance()->getCurrentWindowPtr()->getXScale(),