sdlmisc.inc 1.3 KB

1234567891011121314151617181920212223242526272829
  1. // based on SDL_misc.h
  2. {**
  3. * \brief Open an URL / URI in the browser or other
  4. *
  5. * Open a URL in a separate, system-provided application. How this works will
  6. * vary wildly depending on the platform. This will likely launch what
  7. * makes sense to handle a specific URL's protocol (a web browser for http://,
  8. * etc), but it might also be able to launch file managers for directories
  9. * and other things.
  10. *
  11. * What happens when you open a URL varies wildly as well: your game window
  12. * may lose focus (and may or may not lose focus if your game was fullscreen
  13. * or grabbing input at the time). On mobile devices, your app will likely
  14. * move to the background or your process might be paused. Any given platform
  15. * may or may not handle a given URL.
  16. *
  17. * If this is unimplemented (or simply unavailable) for a platform, this will
  18. * fail with an error. A successful result does not mean the URL loaded, just
  19. * that we launched something to handle it (or at least believe we did).
  20. *
  21. * All this to say: this function can be useful, but you should definitely
  22. * test it on every platform you target.
  23. *
  24. * \param url A valid URL to open.
  25. * \return 0 on success, or -1 on error.
  26. *}
  27. function SDL_OpenURL(const url: PAnsiChar): cint; cdecl;
  28. external {$IFDEF DYNAMIC_LINK}SDL_LibName{$ENDIF} {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_OpenURL' {$ENDIF} {$ENDIF};