Browse Source

SteamLink support

Miodrag Milanovic 9 years ago
parent
commit
c0275c3a77

+ 2 - 0
examples/common/entry/entry_sdl.cpp

@@ -218,6 +218,8 @@ namespace entry
 		return wmi.info.cocoa.window;
 #	elif BX_PLATFORM_WINDOWS
 		return wmi.info.win.window;
+#	elif BX_PLATFORM_STEAMLINK
+		return wmi.info.vivante.window;		
 #	endif // BX_PLATFORM_
 	}
 

+ 3 - 0
include/bgfx/bgfxplatform.h

@@ -279,6 +279,9 @@ namespace bgfx
 #	elif BX_PLATFORM_WINDOWS
 		pd.ndt          = NULL;
 		pd.nwh          = wmi.info.win.window;
+#	elif BX_PLATFORM_STEAMLINK
+		pd.ndt          = wmi.info.vivante.display;
+		pd.nwh          = wmi.info.vivante.window;
 #	endif // BX_PLATFORM_
 		pd.context      = NULL;
 		pd.backBuffer   = NULL;

+ 7 - 1
scripts/bgfx.lua

@@ -88,12 +88,18 @@ function bgfxProject(_name, _kind, _defines)
 				"-weak_framework Metal",
 			}
 
-		configuration { "not nacl" }
+		configuration { "not nacl", "not linux-steamlink" }
 			includedirs {
 				--nacl has GLES2 headers modified...
+				--steamlink has EGL headers modified...
 				path.join(BGFX_DIR, "3rdparty/khronos"),
 			}
 
+		configuration { "linux-steamlink" }
+			defines {
+				"EGL_API_FB",
+			}
+
 		configuration {}
 
 		includedirs {

+ 5 - 0
scripts/example-common.lua

@@ -60,6 +60,11 @@ project ("example-common")
 			"ENTRY_CONFIG_USE_GLFW=1",
 		}
 	end
+	
+	configuration { "linux-steamlink" }
+		defines {
+			"EGL_API_FB",
+		}
 
 	configuration { "osx or ios* or tvos*" }
 		files {

+ 9 - 1
scripts/genie.lua

@@ -304,13 +304,21 @@ function exampleProject(_name)
 		kind "ConsoleApp"
 		targetextension ".bc"
 
-	configuration { "linux-* or freebsd" }
+	configuration { "linux-* or freebsd", "not linux-steamlink" }
 		links {
 			"X11",
 			"GL",
 			"pthread",
 		}
 
+	configuration { "linux-steamlink" }
+		links {
+			"EGL",
+			"GLESv2",
+			"SDL2",
+			"pthread",
+		}
+		
 	configuration { "rpi" }
 		links {
 			"X11",

+ 1 - 0
src/renderer_gl.h

@@ -13,6 +13,7 @@
 			|| BX_PLATFORM_BSD \
 			|| BX_PLATFORM_QNX \
 			|| BX_PLATFORM_RPI \
+			|| BX_PLATFORM_STEAMLINK \
 			|| BX_PLATFORM_WINDOWS \
 			) )