Commits

Alex Szpakowski  committed a28b0f3

Added love.graphics.isSupported(“instancing”). Hardware instancing is supported if true, otherwise a (slower) pseudo-instancing fallback is used internally when drawing instanced meshes.

  • Participants
  • Parent commits 8d6ba0b
  • Branches Mesh-Instancing

Comments (0)

Files changed (3)

File src/modules/graphics/Graphics.cpp

 	{ "mipmap", Graphics::SUPPORT_MIPMAP },
 	{ "dxt", Graphics::SUPPORT_DXT },
 	{ "bc5", Graphics::SUPPORT_BC5 },
+	{ "instancing", Graphics::SUPPORT_INSTANCING },
 };
 
 StringMap<Graphics::Support, Graphics::SUPPORT_MAX_ENUM> Graphics::support(Graphics::supportEntries, sizeof(Graphics::supportEntries));

File src/modules/graphics/Graphics.h

 		SUPPORT_MIPMAP,
 		SUPPORT_DXT,
 		SUPPORT_BC5,
+		SUPPORT_INSTANCING,
 		SUPPORT_MAX_ENUM
 	};
 

File src/modules/graphics/opengl/wrap_Graphics.cpp

 			if (!Image::hasCompressedTextureSupport(image::CompressedData::FORMAT_BC5))
 				supported = false;
 			break;
+		case Graphics::SUPPORT_INSTANCING:
+			if (!GLEE_ARB_draw_instanced)
+				supported = false;
+			break;
 		default:
 			supported = false;
 		}