SDL_OpenURL proposal

Hi, I’m currently porting qfusion engine to SDL2. It has it’s own kinda-sdl

  • a bunch of C functions with platform specific implementations. Most of
    them are easily replaced by sdl analogues. But there is one function that
    does not have analogue - Sys_OpenURLInBrowser. What do you think about
    adding such function to SDL?

Regards, Alexey.

Why not a third-party lib, SDL_OpenURL? It would easily be recognizable as
an SDL utility lib, and could even be promoted on the website.

I just don’t see the vast majority of SDL applications using an open url
function, but maybe I’m wrong.

-AlexOn Thu, Oct 30, 2014 at 12:02 PM, Alexey Petruchik < alexey.petruchik at gmail.com> wrote:

Hi, I’m currently porting qfusion engine to SDL2. It has it’s own
kinda-sdl - a bunch of C functions with platform specific implementations.
Most of them are easily replaced by sdl analogues. But there is one
function that does not have analogue - Sys_OpenURLInBrowser. What do you
think about adding such function to SDL?

Regards, Alexey.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

One needs this every now and then (games linking to websites ingame
aren’t that uncommon), so it makes sense to me.
I’m not even sure if this needs to be URL-specific or if it could be
something that can also open files, like xdg-open on Linux (OSX also has
something similar).

Cheers,
DanielAm 30.10.2014 17:02, schrieb Alexey Petruchik:

Hi, I’m currently porting qfusion engine to SDL2. It has it’s own
kinda-sdl - a bunch of C functions with platform specific
implementations. Most of them are easily replaced by sdl analogues. But
there is one function that does not have analogue

  • Sys_OpenURLInBrowser. What do you think about adding such function to SDL?

Regards, Alexey.

Just to chime in with more support: a function to open URLs (or README
files for that matter) is IMHO basic enough to warrant including in the
base library.

Regards,
DmitryOn Thu, Oct 30, 2014 at 12:17 PM, Daniel Gibson wrote:

One needs this every now and then (games linking to websites ingame aren’t
that uncommon), so it makes sense to me.
I’m not even sure if this needs to be URL-specific or if it could be
something that can also open files, like xdg-open on Linux (OSX also has
something similar).

Cheers,
Daniel

Am 30.10.2014 17:02, schrieb Alexey Petruchik:

Hi, I’m currently porting qfusion engine to SDL2. It has it’s own

kinda-sdl - a bunch of C functions with platform specific
implementations. Most of them are easily replaced by sdl analogues. But
there is one function that does not have analogue

  • Sys_OpenURLInBrowser. What do you think about adding such function to
    SDL?

Regards, Alexey.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I think the problem here is that SDL doesn’t have any networking
functionality whatsoever. So far if you wanted networking you used
SDL_net instead (was that one updated for SDL2? I never used the
satellite libraries so I don’t really know their situation)

Opening URLs/URIs in the system?s designated program for that URI scheme doesn?t really have to do with networking (directly, at least.)

Here?s the code we use in the L?VE game framework to do that: https://bitbucket.org/rude/love/src/tip/src/modules/system/System.cpp?at=default

It works fine for filepaths too, if you prefix the filepath argument with ?file://?.On Oct 30, 2014, at 4:27 PM, Sik the hedgehog <sik.the.hedgehog at gmail.com> wrote:

I think the problem here is that SDL doesn’t have any networking
functionality whatsoever. So far if you wanted networking you used
SDL_net instead (was that one updated for SDL2? I never used the
satellite libraries so I don’t really know their situation)


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I like the idea, a lot of games send you to open a browser, a similirar
function for calling webservices would be very helpful
El oct 30, 2014 1:33 PM, “Alex Szpakowski” escribi?:> Opening URLs/URIs in the system?s designated program for that URI scheme

doesn?t really have to do with networking (directly, at least.)

Here?s the code we use in the L?VE game framework to do that:
https://bitbucket.org/rude/love/src/tip/src/modules/system/System.cpp?at=default

It works fine for filepaths too, if you prefix the filepath argument with ?
file://?.

On Oct 30, 2014, at 4:27 PM, Sik the hedgehog <sik.the.hedgehog at gmail.com> wrote:

I think the problem here is that SDL doesn’t have any networking
functionality whatsoever. So far if you wanted networking you used
SDL_net instead (was that one updated for SDL2? I never used the
satellite libraries so I don’t really know their situation)


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Btw L?VE code is very similar to what I have here in qfusion. So I think it
can be used as a reference.On Fri, Oct 31, 2014 at 4:38 PM, Leon Moctezuma wrote:

I like the idea, a lot of games send you to open a browser, a similirar
function for calling webservices would be very helpful
El oct 30, 2014 1:33 PM, “Alex Szpakowski”
escribi?:

Opening URLs/URIs in the system?s designated program for that URI scheme

doesn?t really have to do with networking (directly, at least.)

Here?s the code we use in the L?VE game framework to do that:
https://bitbucket.org/rude/love/src/tip/src/modules/system/System.cpp?at=default

It works fine for filepaths too, if you prefix the filepath argument with
?file://?.

On Oct 30, 2014, at 4:27 PM, Sik the hedgehog <sik.the.hedgehog at gmail.com> wrote:

I think the problem here is that SDL doesn’t have any networking
functionality whatsoever. So far if you wanted networking you used
SDL_net instead (was that one updated for SDL2? I never used the
satellite libraries so I don’t really know their situation)


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I think this would be a great addition…
Some Services require some token handshake commonly implemented by
visiting a specific URL. Without the possibility to open a link in the
default browser you would have to ask the user for awkward stuff like
copy&pasting urls or use a more complex API for the service.

Heyya,

Out of curiosity, does Windows have anything similar to OS X ‘open’ or Linux xdg-open? It reminds me of a quick batch script I wrote – ‘open.bat’ – for my Windows system that provides a similar experience to those tools when using it to open up the GUI file manager pointing to a particular dir, i.e.: “open .”.

Cheers,
Jeffrey Carpenter
<@Jeffrey_Carpenter>

Le 31/10/2014 23:24, Jeffrey Carpenter a ?crit :

Heyya,

Out of curiosity, does Windows have anything similar to OS X ‘open’ or Linux xdg-open? It reminds me of a quick batch script I wrote – ‘open.bat’ – for my Windows system that provides a similar experience to those tools when using it to open up the GUI file manager pointing to a particular dir, i.e.: “open .”.
Yes, it is the “start” command.>
Cheers,
Jeffrey Carpenter


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

I think the main reason this functionality hasn’t been added is because it
doesn’t work with fullscreen games.On Fri, Oct 31, 2014 at 3:52 PM, Jo?l Thieffry wrote:

Le 31/10/2014 23:24, Jeffrey Carpenter a ?crit :

Heyya,

Out of curiosity, does Windows have anything similar to OS X ‘open’ or
Linux xdg-open? It reminds me of a quick batch script I wrote – ‘open.bat’
– for my Windows system that provides a similar experience to those tools
when using it to open up the GUI file manager pointing to a particular dir,
i.e.: “open .”.
Yes, it is the “start” command.

Cheers,
Jeffrey Carpenter


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Couldn’t it minimize the game?
At least that’s what I as both a player and developer would expect to
happen.

Cheers,
DanielAm 01.11.2014 02:32, schrieb Sam Lantinga:

I think the main reason this functionality hasn’t been added is because
it doesn’t work with fullscreen games.

On Fri, Oct 31, 2014 at 3:52 PM, Jo?l Thieffry <jo at zerezo.com <mailto:jo at zerezo.com>> wrote:

Le 31/10/2014 23:24, Jeffrey Carpenter a ?crit :
> Heyya,
>
> Out of curiosity, does Windows have anything similar to OS X 'open' or Linux xdg-open? It reminds me of a quick batch script I wrote -- 'open.bat' -- for my Windows system that provides a similar experience to those tools when using it to open up the GUI file manager pointing to a particular dir, i.e.: "open .".
Yes, it is the "start" command.

 >
 > Cheers,
 > Jeffrey Carpenter
 > <i8degrees at gmail.com <mailto:i8degrees at gmail.com>>
 >
 > _______________________________________________
 > SDL mailing list
 > SDL at lists.libsdl.org <mailto:SDL at lists.libsdl.org>
 > http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

_______________________________________________
SDL mailing list
SDL at lists.libsdl.org <mailto:SDL at lists.libsdl.org>
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

2014-10-31 22:32 GMT-03:00, Sam Lantinga :

I think the main reason this functionality hasn’t been added is because it
doesn’t work with fullscreen games.

How many games even do it?

Also huh now I see what’s the deal, people want to open a program, not
to load data from an URL (this also means the suggested name is
wrong). Well, that’s a whole different issue then. I don’t think that
fullscreen is much of an issue (the current window will lose focus,
thereby behaving as usual), the fact that sandboxed platforms don’t
allow is a much bigger barrier in my opinion.

PS: to anybody wanting to just call system(), remember that on Windows
that only works with ASCII strings and you’ll need _wsystem() if you
want non-ASCII characters (including conversion to UTF-16, ugh - and
no, it’s not UCS-2, Windows XP introduced surrogate support).

If we were to add this, I think it’s reasonable to say that fullscreen
windows will be forcibly minimized before the browser is launched.

There are other similar questions, like what happens on Android or iOS
when you open a URL and suddenly some other app is in the foreground,
etc…but I think this is solvable, if there’s will to add the API.

–ryan.On 10/31/2014 09:32 PM, Sam Lantinga wrote:

I think the main reason this functionality hasn’t been added is because
it doesn’t work with fullscreen games.

I second the question of what games use this sort of feature.

My comments here are going to be strongly opinionated, and do not necessarily justify anything. And so with that out of the way…

As soon as I reading things like “…minimizing the game”, I start shuddering in horror at the whole idea. From a UX stand point, (especially) when my game is full screen, the last thing I want to see happen is to lose focus of the game window – this completely ruins the experience of immersion. I’d much prefer copy and paste of the URL to open a web browser or what not explicitly. I cannot think of any use case off the top of my head where I find the lose of focus appropriate, other than (of course) OS-level events. In other words, I strongly prefer being in control of explicit focus changes of my game.

I see the counter argument being made where not having the game auto-minimize or what not and open the program automatically could be seen as less user-friendly here. I’d love to hear your own opinion regarding this? (Am I the only one that feels strongly about auto-focus lose?)

I do, however, feel that it is OK for a mobile platform to do so (minimize / lose focus of the game to do another task), perhaps because the underlying platform is fundamentally different, and/or I don’t have 15+ years of habits formed using the platform?

In short, I’d love to hear about your feelings regarding these sorts of UX issues – hopefully without inciting a flame war! :slight_smile:

Cheers,
Jeffrey Carpenter
<@Jeffrey_Carpenter>

2014-11-01 6:14 GMT+01:00 Jeffrey Carpenter :

I second the question of what games use this sort of feature.

My comments here are going to be strongly opinionated, and do not
necessarily justify anything. And so with that out of the way…

As soon as I reading things like “…minimizing the game”, I start
shuddering in horror at the whole idea. From a UX stand point, (especially)
when my game is full screen, the last thing I want to see happen is to
lose focus of the game window – this completely ruins the experience of
immersion. I’d much prefer copy and paste of the URL to open a web browser
or what not explicitly. I cannot think of any use case off the top of my
head where I find the lose of focus appropriate, other than (of course)
OS-level events. In other words, I strongly prefer being in control of
explicit focus changes of my game.

I see the counter argument being made where not having the game
auto-minimize or what not and open the program automatically could be seen
as less user-friendly here. I’d love to hear your own opinion regarding
this? (Am I the only one that feels strongly about auto-focus lose?)

I do, however, feel that it is OK for a mobile platform to do so (minimize
/ lose focus of the game to do another task), perhaps because the
underlying platform is fundamentally different, and/or I don’t have 15+
years of habits formed using the platform?

In short, I’d love to hear about your feelings regarding these sorts of UX
issues – hopefully without inciting a flame war! :slight_smile:

You haven’t really named a single reason why this function shouldn’t be
implemented in SDL,
you only elaborated on why you personally wouldn’t use such a function.

What I meant by “…do not necessarily justify anything” in my opening statement was that my comments were not intended whatsoever for justifying whether or not this feature should be implemented. (I realize that my comments are a matter of taste / preference and certainly should not be used to dismiss the proposal).

My true intentions were really to see how other people feel about UX issues associated with this sort of feature, and is arguably somewhat off-topic! :slight_smile:

Cheers,
Jeffrey Carpenter
<@Jeffrey_Carpenter>On 2014/11/ 01, at 0:29, Jonas Kulla wrote:

2014-11-01 6:14 GMT+01:00 Jeffrey Carpenter <@Jeffrey_Carpenter>:
I second the question of what games use this sort of feature.

My comments here are going to be strongly opinionated, and do not necessarily justify anything. And so with that out of the way…

As soon as I reading things like “…minimizing the game”, I start shuddering in horror at the whole idea. From a UX stand point, (especially) when my game is full screen, the last thing I want to see happen is to lose focus of the game window – this completely ruins the experience of immersion. I’d much prefer copy and paste of the URL to open a web browser or what not explicitly. I cannot think of any use case off the top of my head where I find the lose of focus appropriate, other than (of course) OS-level events. In other words, I strongly prefer being in control of explicit focus changes of my game.

I see the counter argument being made where not having the game auto-minimize or what not and open the program automatically could be seen as less user-friendly here. I’d love to hear your own opinion regarding this? (Am I the only one that feels strongly about auto-focus lose?)

I do, however, feel that it is OK for a mobile platform to do so (minimize / lose focus of the game to do another task), perhaps because the underlying platform is fundamentally different, and/or I don’t have 15+ years of habits formed using the platform?

In short, I’d love to hear about your feelings regarding these sorts of UX issues – hopefully without inciting a flame war! :slight_smile:

You haven’t really named a single reason why this function shouldn’t be implemented in SDL,
you only elaborated on why you personally wouldn’t use such a function.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Sdl is a library of tools that abstract os specific details, not a library
of UX design tools. It should provide easy to access functionality and let
the developer decide how to assemble them. I agree that opening a window
from inside a full screen desktop game is awful but it’s up to the
developer to avoid that situation and up to the user not to use
applications that exhibit that behavior.
El oct 31, 2014 10:42 PM, “Jeffrey Carpenter”
escribi?:> What I meant by “…do not necessarily justify anything” in my

opening statement was that my comments were not intended whatsoever for
justifying whether or not this feature should be implemented. (I realize
that my comments are a matter of taste / preference and certainly should
not be used to dismiss the proposal).

My true intentions were really to see how other people feel about UX
issues associated with this sort of feature, and is arguably somewhat
off-topic! :slight_smile:

Cheers,
Jeffrey Carpenter

On 2014/11/ 01, at 0:29, Jonas Kulla wrote:

2014-11-01 6:14 GMT+01:00 Jeffrey Carpenter :
I second the question of what games use this sort of feature.

My comments here are going to be strongly opinionated, and do not
necessarily justify anything. And so with that out of the way…

As soon as I reading things like “…minimizing the game”, I start
shuddering in horror at the whole idea. From a UX stand point, (especially)
when my game is full screen, the last thing I want to see happen is to
lose focus of the game window – this completely ruins the experience of
immersion. I’d much prefer copy and paste of the URL to open a web browser
or what not explicitly. I cannot think of any use case off the top of my
head where I find the lose of focus appropriate, other than (of course)
OS-level events. In other words, I strongly prefer being in control of
explicit focus changes of my game.

I see the counter argument being made where not having the game
auto-minimize or what not and open the program automatically could be seen
as less user-friendly here. I’d love to hear your own opinion regarding
this? (Am I the only one that feels strongly about auto-focus lose?)

I do, however, feel that it is OK for a mobile platform to do so
(minimize / lose focus of the game to do another task), perhaps because the
underlying platform is fundamentally different, and/or I don’t have 15+
years of habits formed using the platform?

In short, I’d love to hear about your feelings regarding these sorts of
UX issues – hopefully without inciting a flame war! :slight_smile:

You haven’t really named a single reason why this function shouldn’t be
implemented in SDL,
you only elaborated on why you personally wouldn’t use such a function.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

It isn’t unusual to have buttons that lead to the game’s homepage in the
main menu (or in “about” or some other menu option), for promoting that
page, to show the user where he can find patches, addons or support.
Or maybe links to GPU vendors for updated drivers and things like that.

I think as long as this isn’t called from within the game (i.e. when one
is playing and not in the menu) breaking the immersion is not a problem
(but of course it’s not up to SDL to prevent the developer from breaking
the immersion anyway).

Cheers,
DanielAm 01.11.2014 06:14, schrieb Jeffrey Carpenter:

I second the question of what games use this sort of feature.

My comments here are going to be strongly opinionated, and do not necessarily justify anything. And so with that out of the way…

As soon as I reading things like “…minimizing the game”, I start shuddering in horror at the whole idea. From a UX stand point, (especially) when my game is full screen, the last thing I want to see happen is to lose focus of the game window – this completely ruins the experience of immersion. I’d much prefer copy and paste of the URL to open a web browser or what not explicitly. I cannot think of any use case off the top of my head where I find the lose of focus appropriate, other than (of course) OS-level events. In other words, I strongly prefer being in control of explicit focus changes of my game.

I see the counter argument being made where not having the game auto-minimize or what not and open the program automatically could be seen as less user-friendly here. I’d love to hear your own opinion regarding this? (Am I the only one that feels strongly about auto-focus lose?)

I do, however, feel that it is OK for a mobile platform to do so (minimize / lose focus of the game to do another task), perhaps because the underlying platform is fundamentally different, and/or I don’t have 15+ years of habits formed using the platform?

In short, I’d love to hear about your feelings regarding these sorts of UX issues – hopefully without inciting a flame war! :slight_smile:

Cheers,
Jeffrey Carpenter


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org