diff --git a/examples/common/entry/entry_sdl.cpp b/examples/common/entry/entry_sdl.cpp index 2bff90230..989d0ae06 100644 --- a/examples/common/entry/entry_sdl.cpp +++ b/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_ } diff --git a/include/bgfx/bgfxplatform.h b/include/bgfx/bgfxplatform.h index 1b6e336b6..52b330112 100644 --- a/include/bgfx/bgfxplatform.h +++ b/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; diff --git a/scripts/bgfx.lua b/scripts/bgfx.lua index cc646b6e2..97ec723dd 100644 --- a/scripts/bgfx.lua +++ b/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 { diff --git a/scripts/example-common.lua b/scripts/example-common.lua index 1832f9836..fcaca364f 100644 --- a/scripts/example-common.lua +++ b/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 { diff --git a/scripts/genie.lua b/scripts/genie.lua index 77fe35d4c..52554366d 100644 --- a/scripts/genie.lua +++ b/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", diff --git a/src/renderer_gl.h b/src/renderer_gl.h index f347071e5..ffd8b654f 100644 --- a/src/renderer_gl.h +++ b/src/renderer_gl.h @@ -13,6 +13,7 @@ || BX_PLATFORM_BSD \ || BX_PLATFORM_QNX \ || BX_PLATFORM_RPI \ + || BX_PLATFORM_STEAMLINK \ || BX_PLATFORM_WINDOWS \ ) )