SDL_OpenURL proposal |
SDL_OpenURL proposal |
MrOzBarry
|
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. -Alex On Thu, Oct 30, 2014 at 12:02 PM, Alexey Petruchik wrote:
|
|||||||||||||
|
SDL_OpenURL proposal |
Daniel Gibson
Guest
|
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:
_______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||
|
SDL_OpenURL proposal |
Dmitry Rekman
Guest
|
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, Dmitry On Thu, Oct 30, 2014 at 12:17 PM, Daniel Gibson wrote:
|
|||||||||||||||
|
SDL_OpenURL proposal |
Sik
|
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 http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||
|
SDL_OpenURL proposal |
Alex Szpakowski
Guest
|
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 “[url=file://“]file://“[/url]. On Oct 30, 2014, at 4:27 PM, Sik the hedgehog wrote:
|
|||||||||||||
|
SDL_OpenURL proposal |
Leon Moctezuma
Guest
|
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ó:
|
|||||||||||||||
|
SDL_OpenURL proposal |
Alexey Petruchik
Guest
|
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:
|
|||||||||||||||||
|
SDL_OpenURL proposal |
Robotic-Brain
Guest
|
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. _______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||
|
SDL_OpenURL proposal |
Jeffrey Carpenter
Guest
|
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 _______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||
|
SDL_OpenURL proposal |
Joël Thieffry
Guest
|
Le 31/10/2014 23:24, Jeffrey Carpenter a écrit :
_______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||||
|
SDL_OpenURL proposal |
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 wrote:
|
|||||||||||||||||
|
SDL_OpenURL proposal |
Daniel Gibson
Guest
|
Couldn't it minimize the game?
At least that's what I as both a player and developer would expect to happen. Cheers, Daniel Am 01.11.2014 02:32, schrieb Sam Lantinga:
_______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||||||
|
SDL_OpenURL proposal |
Sik
|
2014-10-31 22:32 GMT-03:00, Sam Lantinga:
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). _______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||
|
SDL_OpenURL proposal |
Ryan C. Gordon
Guest
|
On 10/31/2014 09:32 PM, Sam Lantinga wrote:
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. _______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||
|
SDL_OpenURL proposal |
Jeffrey Carpenter
Guest
|
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! :-) Cheers, Jeffrey Carpenter _______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||
|
SDL_OpenURL proposal |
Jonas Kulla
Guest
|
2014-11-01 6:14 GMT+01:00 Jeffrey Carpenter:
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_OpenURL proposal |
Jeffrey Carpenter
Guest
|
<nods> 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! :-) Cheers, Jeffrey Carpenter On 2014/11/ 01, at 0:29, Jonas Kulla wrote:
_______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||
|
SDL_OpenURL proposal |
Jorge Rodriguez
Guest
|
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ó:
|
|||||||||||||||
|
SDL_OpenURL proposal |
Daniel Gibson
Guest
|
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, Daniel Am 01.11.2014 06:14, schrieb Jeffrey Carpenter:
_______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||
|
SDL_OpenURL proposal |
Alexey Petruchik
Guest
|
So... it's seems that I'm not alone here requesting this feature. Talking about fullscreen interaction I think it's not such a big problem. We can easily stick to default platform behaviour - almost all OSes will minimize game for us and almost all developers know what they are doing when they add open-url-in-browser buttons in their UI. Really looking forward to see this function in SDL master.
On Sat, Nov 1, 2014 at 5:47 PM, Daniel Gibson wrote:
|
|||||||||||||||
|
SDL_OpenURL proposal |
Luke Groeninger
Guest
|
I tend to agree that directing a user to a website is a fairly specific high level task that is probably best left up to the application developer to decide how they want to handle it. Not only would it be terrible UX to kick the user outside of an application, but given things like Steam and Origin have overlays specifically designed to display webpages without the application losing focus, it’s a lot more complicated than simply throwing a URL at an OS call. It is far better to simply not try to tackle that problem inside SDL than it is to implement a half assed solution for SDL.
THAT SAID. The idea of having an API that calls out to start/open/xdg-open/whatever is not actually a bad one. It would fall in line with functions like SDL_strncmp and SDL_malloc as a wrapper for common operating system functionality, and ultimately would leave it up to the developer as to what URI they pass to the system and up to the operating system what would happen with it. But, that’s not SDL_OpenURL - that’s SDL_open or SDL_launch or similar. Implementing a wrapper for a common OS call is a very different story than trying to cram a high level task into a low level library. -Luke
_______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||||
|
SDL_OpenURL proposal |
Robotic-Brain
Guest
|
The Topic specifically asks for "Opening an URL in the standard
browser", but if it's really just a wrapper for some OS call what about SDL_openOsHandle or just SDL_osHandle? Also I don't think the UX is too terrible. If you click on a big button "Open in Browser" the user will expect to get kicked out of the application. Of course this should never happen without the users consent, but that's outside the scope of SDL... I think SDL_open could be confused with a SDL version of fopen Am 01.11.2014 18:25, schrieb Luke Groeninger:
SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||||||
|
SDL_OpenURL proposal |
Alexey Petruchik
Guest
|
Wouldn't changing from "open URL in default browser" to more generic "open some file in default program" make things more complicated to implement on all platforms? Seems pretty obvious for Windows\OSX\Linux but what about iOS\Android and others?
On Sat, Nov 1, 2014 at 8:00 PM, Robotic-Brain wrote:
|
|||||||||||||||||||
|
SDL_OpenURL proposal |
Alex Szpakowski
Guest
|
The functions to do the former also do the latter on Mac/Windows/Linux/iOS/Android, I believe.
On Nov 2, 2014, at 1:00 PM, Alexey Petruchik wrote:
_______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||||
|
SDL_OpenURL proposal |
Alexey Petruchik
Guest
|
I've created feature request in bugzilla https://bugzilla.libsdl.org/show_bug.cgi?id=2783
On Sun, Nov 2, 2014 at 8:05 PM, Alex Szpakowski wrote:
|
|||||||||||||||
|
SDL_OpenURL proposal |
Eric Wing
Guest
|
Sorry, I'm really late on this one too. But I have useful info I hope.
There are official APIs for opening a URL on Mac, iOS, Android, and Windows. I don't know about Linux except for the command line xdg-open. Mac NSURL the_url = [NSURL URLWithString:@"http://www.apple.com"]; [[NSWorkspace sharedWorkspace] openURL:the_url]; iOS NSURL the_url = [NSURL URLWithString:@"http://www.apple.com"]; [[UIApplication sharedApplication] openURL:the_url]; Windows: LONG r = ShellExecute(NULL, "open", "http://www.microsoft.com", NULL, NULL, SW_SHOWNORMAL); (maybe that should be ShellExecuteA) I forgot the details of Android, but you use Intents. http://stackoverflow.com/questions/3004515/android-sending-an-intent-to-browser-to-open-specific-url String url = "http://www.example.com"; Intent i = new Intent(Intent.ACTION_VIEW); i.setData(Uri.parse(url)); startActivity(i); Now please don't limit URLs to just http://. It is very common on Mac, iOS, and Android to use custom URLs to launch specific apps. Sometimes they are for popular protocols so people spontaneously conform their apps to URL schemes that get documented so their apps can handle them too, say like twitter:// (The OS may have an arbitration system if multiple apps handle the same URL scheme.) http://wiki.akosma.com/IPhone_URL_Schemes Particularly in mobile games, I've seen a lot of developers cross-promote their apps, where one app can launch another and maybe you win points or something for doing so. The Mac and iOS code will just work for that case. I think Windows may work too. Android is a little more involved if I remember and you may have to add more cases, but I've totally forgotten the details of how it works. Also, there is a counterpart system to this. It is also handy to know when you've been launched via OpenURL. And you need to be able to parse the URL string for information that was passed. For example, most text editors on the Mac respond to URL schemes (even MacVim) and you can tell it to open a specific file at a specific line number. Or in the cross-promotional example above, you want to know which app launched you. The receiving app needs a notification that OpenURL was invoked with a particular string. Also, keep in mind that the app may or may not have been already running when this even happened. Thanks, Eric -- Beginning iPhone Games Development http://playcontrol.net/iphonegamebook/ _______________________________________________ SDL mailing list http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org |
|||||||||||
|