Skip to content

Conversation

1bsyl
Copy link
Contributor

@1bsyl 1bsyl commented Jun 20, 2023

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 1bsyl mentioned this pull request Jun 20, 2023
@1bsyl 1bsyl force-pushed the br_location branch 3 times, most recently from 57b60ce to 9caffbe Compare June 20, 2023 08:53
@slouken
Copy link
Collaborator

slouken commented Jun 20, 2023

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?

@icculus
Copy link
Collaborator

icculus commented Jun 20, 2023

What's the use case for this?

Pokemon Go.

@1bsyl
Copy link
Contributor Author

1bsyl commented Jun 21, 2023

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

@1bsyl
Copy link
Contributor Author

1bsyl commented Jun 21, 2023

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

@slouken
Copy link
Collaborator

slouken commented Jun 21, 2023

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.

@1bsyl
Copy link
Contributor Author

1bsyl commented Jun 22, 2023

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.

Uint64 timestamp; /**< In nanoseconds, populated using SDL_GetTicksNS() */
double latitude; /**< Latitude in degrees */
double longitude; /**< Longitude in degrees */
double altitude; /**< Altitude in meters */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should add "accuracy". Most apps ignore inaccurate position or display a circle to show accuracy to user.

@icculus icculus added this to the 3.2.0 milestone Aug 7, 2023
@icculus
Copy link
Collaborator

icculus commented Aug 7, 2023

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
Copy link
Collaborator

icculus commented Aug 7, 2023

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

@slouken slouken modified the milestones: 3.2.0, 3.x May 20, 2024
@isage
Copy link
Contributor

isage commented Mar 12, 2025

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.

@1bsyl 1bsyl reopened this Aug 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants