Coder Social home page Coder Social logo

Comments (2)

floooh avatar floooh commented on August 15, 2024 1

Hmm yeah I'm seeing the same thing in the "doom-sokol" example (on Windows, haven't tested other platforms).

One workaround seems to be to disable, and then enable again the mouse lock in the FOCUSED event like this:

https://github.com/floooh/doom-sokol/blob/e87eb25c648f6cc4731fc1a6ba3f72df24abd826/src/doomgeneric_sokol.c#L552-L555

...the explicit disabling is necessary because of this check:

sokol/sokol_app.h

Lines 7096 to 7098 in f30824c

if (lock == _sapp.mouse.locked) {
return;
}

I seem to remember that this was necessary because there's a Windows routine somewhere in there which has something like a reference counter.

Maybe the same is necessary when going from iconified back to restored.

Btw: I'll be travelling from tomorrow until Thursday, I may not respond during that time.

PS: I should really tackle that higher level "sokol_input.h" header which tracks input events, provides a polling API and takes care of little warts like this that are hard to do right down in sokol_app.h with its "stateless" input events.

from sokol.

jakubtomsu avatar jakubtomsu commented on August 15, 2024

Thank you, I'll try that out.
The sokol_input header would be cool, especially if there was also support for gamepads (or have a separate sokol_gamepad which I've seen mentioned)

from sokol.

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.