Expose SDL_OpenURL to mod code.
This commit is contained in:
committed by
Gustas Kažukauskas
parent
de952e6caf
commit
c7e67529b5
@@ -66,6 +66,7 @@ namespace OpenRA
|
||||
void PumpInput(IInputHandler inputHandler);
|
||||
string GetClipboardText();
|
||||
bool SetClipboardText(string text);
|
||||
bool TryOpenUrl(string url);
|
||||
|
||||
void GrabWindowMouseFocus();
|
||||
void ReleaseWindowMouseFocus();
|
||||
|
||||
@@ -568,6 +568,11 @@ namespace OpenRA
|
||||
return Window.SetClipboardText(text);
|
||||
}
|
||||
|
||||
public bool TryOpenUrl(string url)
|
||||
{
|
||||
return Window.TryOpenUrl(url);
|
||||
}
|
||||
|
||||
public string GLVersion => Context.GLVersion;
|
||||
|
||||
public int DisplayCount => Window.DisplayCount;
|
||||
|
||||
@@ -513,6 +513,18 @@ namespace OpenRA.Platforms.Default
|
||||
return Sdl2Input.SetClipboardText(text);
|
||||
}
|
||||
|
||||
public bool TryOpenUrl(string url)
|
||||
{
|
||||
try
|
||||
{
|
||||
return SDL.SDL_OpenURL(url) == 0;
|
||||
}
|
||||
catch
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
static void SetSDLAttributes(GLProfile profile)
|
||||
{
|
||||
SDL.SDL_GL_ResetAttributes();
|
||||
|
||||
Reference in New Issue
Block a user