Update window api, add content scale for glfw window
This commit is contained in:
@@ -52,10 +52,15 @@ namespace OpenVulkano::GLFW
|
||||
|
||||
void WindowGLFW::Create()
|
||||
{
|
||||
glfwWindowHint(GLFW_RESIZABLE, windowConfig.resizeable);
|
||||
glfwWindowHint(GLFW_DECORATED, (~windowConfig.windowMode) & 1);
|
||||
glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, windowConfig.transparentFrameBuffer);
|
||||
//TODO handle full screen resolutions
|
||||
window = glfwCreateWindow(windowConfig.size.x, windowConfig.size.y, windowConfig.title.c_str(), GetTargetMonitor(), nullptr);
|
||||
if (!window) return;
|
||||
float scaleX, scaleY;
|
||||
glfwGetWindowContentScale(window, &scaleX, &scaleY);
|
||||
contentScale = std::max(scaleX, scaleY);
|
||||
glfwSetWindowUserPointer(window, this);
|
||||
RegisterCallbacks();
|
||||
}
|
||||
@@ -114,7 +119,7 @@ namespace OpenVulkano::GLFW
|
||||
throw WindowInitFailedException("Failed to initialize window");
|
||||
}
|
||||
if (renderApi != RenderAPI::Vulkan) MakeCurrentThread();
|
||||
Logger::WINDOW->info("GLFW Window created (id: {0})", GetWindowId());
|
||||
Logger::WINDOW->info("GLFW Window created (id: {0}) with scale {}", GetWindowId(), contentScale);
|
||||
}
|
||||
|
||||
void WindowGLFW::Close()
|
||||
|
||||
Reference in New Issue
Block a user