diff --git a/scripts/bgfx.lua b/scripts/bgfx.lua index 3c529d80d..d815fe0be 100644 --- a/scripts/bgfx.lua +++ b/scripts/bgfx.lua @@ -143,10 +143,11 @@ function bgfxProject(_name, _kind, _defines) "-weak_framework MetalKit", } - configuration { "not nacl", "not linux-steamlink" } + configuration { "not nacl", "not linux-steamlink", "not NX32", "not NX64" } includedirs { --nacl has GLES2 headers modified... --steamlink has EGL headers modified... + --NX has EGL headers modified... path.join(BGFX_DIR, "3rdparty/khronos"), } diff --git a/src/config.h b/src/config.h index 5b01678e1..34226e31c 100644 --- a/src/config.h +++ b/src/config.h @@ -66,6 +66,7 @@ || BX_PLATFORM_QNX \ || BX_PLATFORM_RPI \ || BX_PLATFORM_STEAMLINK \ + || BX_PLATFORM_NX \ ? 1 : 0) # endif // BGFX_CONFIG_RENDERER_OPENGLES @@ -74,6 +75,7 @@ || BX_PLATFORM_ANDROID \ || BX_PLATFORM_LINUX \ || BX_PLATFORM_WINDOWS \ + || BX_PLATFORM_NX \ ? 1 : 0) # endif // BGFX_CONFIG_RENDERER_VULKAN diff --git a/src/renderer_gl.h b/src/renderer_gl.h index 259993038..4630e5379 100644 --- a/src/renderer_gl.h +++ b/src/renderer_gl.h @@ -15,6 +15,7 @@ || BX_PLATFORM_RPI \ || BX_PLATFORM_STEAMLINK \ || BX_PLATFORM_WINDOWS \ + || BX_PLATFORM_NX \ ) ) #define BGFX_USE_WGL (BGFX_CONFIG_RENDERER_OPENGL && BX_PLATFORM_WINDOWS) @@ -82,11 +83,15 @@ typedef uint64_t GLuint64; # define GL_HALF_FLOAT GL_HALF_FLOAT_OES # define GL_RGBA8 GL_RGBA8_OES # define GL_UNSIGNED_INT_2_10_10_10_REV GL_UNSIGNED_INT_2_10_10_10_REV_EXT -# define GL_TEXTURE_3D GL_TEXTURE_3D_OES +# ifndef BX_PLATFORM_NX +# define GL_TEXTURE_3D GL_TEXTURE_3D_OES +# endif # define GL_SAMPLER_3D GL_SAMPLER_3D_OES # define GL_TEXTURE_WRAP_R GL_TEXTURE_WRAP_R_OES -# define GL_MIN GL_MIN_EXT -# define GL_MAX GL_MAX_EXT +# ifndef BX_PLATFORM_NX +# define GL_MIN GL_MIN_EXT +# define GL_MAX GL_MAX_EXT +# endif # define GL_DEPTH_COMPONENT24 GL_DEPTH_COMPONENT24_OES # define GL_DEPTH24_STENCIL8 GL_DEPTH24_STENCIL8_OES # define GL_DEPTH_COMPONENT32 GL_DEPTH_COMPONENT32_OES