mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-22 19:29:04 -05:00
Potential fix for High-DPI and manual framebuffer sizes by using SGCT window scaling
This commit is contained in:
@@ -56,7 +56,7 @@ public:
|
||||
bool keyCallback(Key key, KeyModifier modifier, KeyAction action);
|
||||
bool charCallback(unsigned int character, KeyModifier modifier);
|
||||
|
||||
void startFrame(float deltaTime, const glm::vec2& windowSize, const glm::vec2& mousePosCorrectionFactor, const glm::vec2& mousePos, uint32_t mouseButtons);
|
||||
void startFrame(float deltaTime, const glm::vec2& windowSize, const glm::vec2& dpiScaling, const glm::vec2& mousePos, uint32_t mouseButtons);
|
||||
void endFrame();
|
||||
|
||||
void render();
|
||||
|
||||
@@ -406,13 +406,13 @@ void GUI::deinitializeGL() {
|
||||
}
|
||||
|
||||
void GUI::startFrame(float deltaTime, const glm::vec2& windowSize,
|
||||
const glm::vec2& framebufferSize,
|
||||
const glm::vec2& dpiScaling,
|
||||
const glm::vec2& mousePos,
|
||||
uint32_t mouseButtonsPressed)
|
||||
{
|
||||
ImGuiIO& io = ImGui::GetIO();
|
||||
io.DisplaySize = ImVec2(windowSize.x, windowSize.y);
|
||||
io.DisplayFramebufferScale = ImVec2(framebufferSize.x / windowSize.x, framebufferSize.y / windowSize.y);
|
||||
io.DisplayFramebufferScale = ImVec2(dpiScaling.x, dpiScaling.y);
|
||||
io.DeltaTime = deltaTime;
|
||||
|
||||
io.MousePos = ImVec2(mousePos.x, mousePos.y);
|
||||
|
||||
Reference in New Issue
Block a user