Skip to content

Create window with physical dimensions #615

Closed

Description

@spearman

With the change to LogicalSize there's no way to create a window with desired physical dimensions without checking DPI and resizing after it's created.

Activity

  1. added
    S - api
    C - needs discussion
    on Nov 24, 2018
  2. francesca64 commented on Nov 24, 2018

    @francesca64
    Member

    Sorry I never addressed this! There's already some discussion on this here: #591 (comment)

  3. AnneKitsune commented on Dec 12, 2018

    @AnneKitsune

    Here's a small piece of code I just wrote for amethyst which does just that.

    let hidpi = self.events.get_primary_monitor().get_hidpi_factor();
    
    if let Some(dimensions) = self.config.dimensions {
        wb = wb.with_dimensions(LogicalSize::from_physical(dimensions, hidpi));
    }

    get_primary_monitor() returns MonitorId.
    wb is winit's WindowBuilder.

  4. Osspial commented on Apr 24, 2019

    @Osspial
    Contributor

    Closing in favor of #837

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    C - needs discussionS - api

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions