Skip to content

Scaling issue in the Vulkan/GLFW demo on retina display #918

@csheinlen

Description

@csheinlen

I had scaling issues with the Vulkan/GLFW demo causing the UI to render at half size in the upper left quadrant of the window in macOS. I was able fix this by using the scale factor in glfw.fb_scale when setting the width/height values in render_pass_begin_info and viewport in nk_glfw3_render:

render_pass_begin_nfo.renderArea.extent.width = (uint32_t)(glfw.width * glfw.fb_scale.x);
render_pass_begin_nfo.renderArea.extent.height = (uint32_t)(glfw.height * glfw.fb_scale.y);
...
viewport.width = (float)(glfw.width * glfw.fb_scale.x);
viewport.height = (float)(glfw.height * glfw.fb_scale.y);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions