Giter Site home page Giter Site logo

Comments (3)

rekabrnalla avatar rekabrnalla commented on May 27, 2024

I also see this problem on Mac OS. I have an M1 Mac Mini with macOS Ventura. 13.1. 32-inch (3840 × 2160)
Version 0.3.1 of game zero.jl

I have to add the *2 to the mouse position to make the cursor properly track. The window is drawn twice as big as it should be. The lines are only in the 1st quadrant and do not fill the window.

Also I cannot close the window by x-ing out of it. It hangs around even though the prompt comes back in Julia.

Example code below that can be put into a file and run with gamezero.

# initialize screen

WIDTH = 600
HEIGHT = 600
BACKGROUND = colorant"antiquewhite"

# define initial state of actors

hline = Line(0, 300, 600, 300)
vline = Line(300, 0, 300, 600)
mouse = Circle(300,300,50)


function draw(g::Game)
    draw(hline, colorant"black")
    draw(vline, colorant"black")
    draw(mouse, colorant"blue", fill=true)
end


#define mouse inputs
 function on_mouse_move(g::Game, pos)
    mouse.x = pos[1]*2
    mouse.y = pos[2]*2
 end

from gamezero.jl.

aviks avatar aviks commented on May 27, 2024

Yes, unfortunately I haven't been able to find a fix for this yet.

I use GameZero/SDL2 on Windows with a HiDPI display, and it works correctly. It even works with fractional scaling (my monitors are set to 175% and 150% scaling).

SO suggests the corrent way to handle this in SDL is to set SDL_WINDOW_ALLOW_HIGHDPI when creating windows, which we do use here , and that seems to work correctly on windows.

Would appreciate any ideas or investigations.

from gamezero.jl.

rekabrnalla avatar rekabrnalla commented on May 27, 2024

So is there a change to the code above that I need to make to resolve it or is it just unusable on MAC.

We just need to pass this issue to the SimpleDirectMediaLayer people? Or is there a different combination of switches that MACOS need?

from gamezero.jl.

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.