SDL icon indicating copy to clipboard operation
SDL copied to clipboard

SDL Location API

Open 1bsyl opened this issue 2 years ago • 10 comments

Some proposal for SDL Location API. (see #7758)

2 new functions: SDL_StartLocation() and SDL_StopLocation(),

  • SDL_EVENT_LOCATION, that would transmit periodically Latitude/Longitude/Altitude

added:

  • testlocation.c

Platform supported:

  • linux using DBus portal location interface

1bsyl avatar Jun 20 '23 07:06 1bsyl

As well as this fits code-wise into SDL, I'm not sure that it fits the goal of SDL as a cross-platform game/media development library. What's the use case for this?

slouken avatar Jun 20 '23 14:06 slouken

What's the use case for this?

Pokemon Go.

icculus avatar Jun 20 '23 15:06 icculus

Yep, some app could mix game concept and real location !

1bsyl avatar Jun 21 '23 07:06 1bsyl

I don't really need this, but if we want it for SDL3, maybe we would merge before have all back-ends.

Then, this is a more global suggestion about workflow for new API that needs multiple back-end: We could merge them before having all the back-end implemented.

  • because different back-end implementation tends to come for different developers and so different PRs.
  • it allows testing earlier / and feedback
  • easier not to have to continuously resolve merge for the PR

Of course, the drawback is to publish an unstable API, not satisfying all back-ends. but we can maintain some file "pending_api" to remember those API, and review them before release (eventually commenting them out).

or some header macro / SDL_UNSTABLE: that would comment out those API

1bsyl avatar Jun 21 '23 09:06 1bsyl

I think any API that is in the exploratory phase and has incomplete implementations should be worked on in a fork. This is especially important once we release SDL 3.0 and we have committed to ABI compatibility - we don't want to release an API that isn't done and have to change it or remove it later.

slouken avatar Jun 21 '23 15:06 slouken

I meant this as a generic thing, for some other PR (like SDL_notification), not necessary SDL location. If someone want to explore those API and provide back-end when this isn't really available yet

Something like SDLCALL, adding something SDL_API_UNSTABLE which wouldn't publish the API when releasing. Eg, API wouldn't be part of the released ABI. I think that would ease.

1bsyl avatar Jun 22 '23 09:06 1bsyl

I'm putting this into the 3.2.0 milestone, in case it makes sense to make it into the initial release, but this can safely be added as a new API later, so I won't be offended if this bounces out to 3.x for not being ready in time.

icculus avatar Aug 07 '23 18:08 icculus

(But I do think this would be a fun feature to include for mobile games.)

icculus avatar Aug 07 '23 18:08 icculus

This looks good and i can implement that for vita (and probably psp). But i don't think src/misc/SDL_url.c (or even src/misc ) is the right place for that.

isage avatar Mar 12 '25 13:03 isage

Considering there a "local" location tracking / positioning things for "special computing", eg VR games etc. , I think it would make sense to add something like "Geo" to the naming here.

Green-Sky avatar Nov 15 '25 11:11 Green-Sky