GithubHelp home page GithubHelp logo

Comments (5)

jdoleary avatar jdoleary commented on June 4, 2024

So it appears that this is intentional because glfw is adjusting the screen size based on the dpi. However, this yields unexpected results when attempting to display shapes relative to the screen proportions. For example, the below code requires a transform of 0,200 to display shapes at 0,0 in the upper left hand corner.

    gs_vec2 screenSize = gs_platform_window_sizev(gs_platform_main_window());
    gs_println("screen size: %f, %f", screenSize.x, screenSize.y);

    gsi_camera2D(&gsi);
    gsi_push_matrix(&gsi, GSI_MATRIX_MODELVIEW);

    // The below rectangle and circle are NOT displayed at origin without this transform:
    // gsi_transf(&gsi, 0.f, 200.f, 0.f);

    gsi_rectv(&gsi, gs_v2(0.f, 0.f), screenSize, GS_COLOR_GREEN, GS_GRAPHICS_PRIMITIVE_LINES);
    gsi_circle(&gsi, 0.f, 0.f, 50.f, 20, 100, 150, 220, 255, GS_GRAPHICS_PRIMITIVE_TRIANGLES);
    gsi_pop_matrix(&gsi);

from gunslinger.

jdoleary avatar jdoleary commented on June 4, 2024

Even running the example 14_immediate_draw doesn't display the full example, it's extremely zoomed in.

from gunslinger.

jdoleary avatar jdoleary commented on June 4, 2024

As I thought, this was due to the windows setting scaling everything.
display_scale
I do think this still counts as a bug, because this setting will totally ruin the display of users who have scaling on.

from gunslinger.

jdoleary avatar jdoleary commented on June 4, 2024

Here are pictures with the "Scale and Layout" percentage set to 150% and 100% respectively.
150%
150
100%
100

from gunslinger.

jdoleary avatar jdoleary commented on June 4, 2024

Fixed

from gunslinger.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.