sdl/system_android: Add SDL_IsAndroidTV() for SDL2 2.0.8
package sdl
-// #include "sdl_wrapper.h"
+/*
+#include "sdl_wrapper.h"
+
+#if !(SDL_VERSION_ATLEAST(2,0,8))
+#pragma message("SDL_IsAndroidTV is not supported before SDL 2.0.8")
+static int SDL_IsAndroidTV(void)
+{
+ return -1;
+}
+#endif
+*/
import "C"
import "unsafe"
@@ -42,3 +52,9 @@ func AndroidGetJNIEnv() unsafe.Pointer {
func AndroidGetActivity() unsafe.Pointer {
return unsafe.Pointer(C.SDL_AndroidGetActivity())
}
+
+// IsAndroidTV returns true if the application is running on Android TV
+// (https://wiki.libsdl.org/SDL_IsAndroidTV)
+func IsAndroidTV() bool {
+ return C.SDL_IsAndroidTV() >= 0
+}
