Giter Club home page Giter Club logo

Comments (19)

flibitijibibo avatar flibitijibibo commented on August 12, 2024

This has to do with the fact that we track window mouse state instead of global mouse state. We actually have a call for this...

https://wiki.libsdl.org/SDL_GetGlobalMouseState

But irritatingly we have to base the XNA position on the current Mouse.WindowHandle, and while we do have SDL_GetWindowPosition, we also need information about the window borders, which is info that's only in upstream right now (and only for X11, looking into this today).

Once we have all the calls we need this can be fixed, but it'll highlight the fact that you should really only call this function once per frame...

from fna.

flibitijibibo avatar flibitijibibo commented on August 12, 2024

Upon closer examination it appears this only applies to Linux... the existing window code for Cocoa/Win32 happens to do the border thing correctly.

CC'ing @cra0zy as I believe he went in and dealt with this by changing the GetWindowPosition results. If it turns out this is the case I'll get this into fnalibs and send it off to Ryan/Sam directly.

from fna.

harry-cpp avatar harry-cpp commented on August 12, 2024

Just gonna add the link here as well: https://bugzilla.libsdl.org/show_bug.cgi?id=3085

from fna.

flibitijibibo avatar flibitijibibo commented on August 12, 2024

This is fixed in upstream using the latest fnalibs.tar.bz2:

86b0bc8

@cra0zy, @mrhelmut, whenever you have patches to SDL for MG, CC me in the Bugzilla report. If I can validate it before Ryan/Sam can get to it I'll be pushing it here from now on for both of us to use:

https://github.com/FNA-XNA/SDL-mirror

from fna.

harry-cpp avatar harry-cpp commented on August 12, 2024

@flibitijibibo Are you marking the SDL in fnalibs.tar.bz2 with SDL 2.0.5 or keeping the version at 2.0.4?

from fna.

flibitijibibo avatar flibitijibibo commented on August 12, 2024

I've kept it at 2.0.4. For MG you'll want to bump it up by hand to keep it working with the current revision's workaround check. If you want to do a workaround check without doing version checks, call SDL_SetWindowResizable; if it throws EntryPointNotFound, they're not on this branch.

from fna.

harry-cpp avatar harry-cpp commented on August 12, 2024

If you want to do a workaround check without doing version checks, call SDL_SetWindowResizable; if it throws EntryPointNotFound, they're not on this branch.

You and I have the same hacky workaraounds :D
https://github.com/SirCmpwn/TrueCraft/pull/245/files

from fna.

flibitijibibo avatar flibitijibibo commented on August 12, 2024

Dohoho, yeah I wish I could just check with a LoadObject/GetProcAddress, but here we are. Luckily I only ever see this get called once per game, so it's not terrible...?

from fna.

harry-cpp avatar harry-cpp commented on August 12, 2024

so it's not terrible...?

I think @SirCmpwn would disagree with us :P

from fna.

flibitijibibo avatar flibitijibibo commented on August 12, 2024

@SirCmpwn would disagree with us because he's totally right. But doing a LoadObject/GetProcAddress on SDL2 itself would be... interesting, to say the least. It's a very specific case.

Xwt really should do a check, but that's life with GUI libs other than ImGui.

from fna.

harry-cpp avatar harry-cpp commented on August 12, 2024

https://github.com/AvaloniaUI/Avalonia

from fna.

ddevault avatar ddevault commented on August 12, 2024

shudders

from fna.

ddevault avatar ddevault commented on August 12, 2024

FWIW the feature this issue talks about is meaningless on Wayland (by design).

from fna.

harry-cpp avatar harry-cpp commented on August 12, 2024

the feature this issue talks about is meaningless on Wayland (by design).

Why?

from fna.

ddevault avatar ddevault commented on August 12, 2024

Because Wayland clients don't have access to the mouse outside of their window at all. In fact, that could be meaningless in general if the compositor uses a novel design, perhaps arranging windows in 3D space.

from fna.

flibitijibibo avatar flibitijibibo commented on August 12, 2024

Additionally, a lot of mouse input stuff isn't in Wayland for reasons that mostly apply to other software - nothing other than a first-person game should ever warp the mouse, for example. Some of the bigger Linux vendors have been trying to push for compatibility, but I can totally see why it wasn't in the original spec.

My guess is that when someone writes the WL_GetGlobalMouseState in SDL it's going to just clip at the edges like GetPosition does (since it'll just get coords from event data).

from fna.

ddevault avatar ddevault commented on August 12, 2024

Generally speaking I don't see this feature as useful anyway within the expected use-cases of FNA/MonoGame/XNA - making games. I can't think of any game that actually needs to know about the mouse's position outside of the game window.

from fna.

flibitijibibo avatar flibitijibibo commented on August 12, 2024

The use case I've seen is cursor drawing; some just draw the cursor all the time even if the mouse is out of the viewport. For windowed mode it lets the cursor move in and out seamlessly without the cursor just getting stuck in a corner (though some fade the cursor out after it stops "moving").

There's hardware cursors, of course, but that requires some direct interop to happen (in our case it's SDL_CreateColorCursor and SDL_SetCursor).

from fna.

ddevault avatar ddevault commented on August 12, 2024

I guess. Seems more like a somewhat-nice-to-have than a necessary feature.

from fna.

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.