Browse Source

Allow drawing a Mesh that has no VertexPosition attribute, if it has custom attributes.

Sasha Szpakowski 1 year ago
parent
commit
4387935f16
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/modules/graphics/Mesh.cpp

+ 2 - 2
src/modules/graphics/Mesh.cpp

@@ -634,8 +634,8 @@ void Mesh::drawInternal(Graphics *gfx, const Matrix4 &m, int instancecount, Buff
 	}
 
 	// Not supported on all platforms or GL versions, I believe.
-	if (!attributes.isEnabled(ATTRIB_POS))
-		throw love::Exception("Mesh must have an enabled VertexPosition attribute to be drawn.");
+	if ((attributes.enableBits & ~(ATTRIBFLAG_TEXCOORD | ATTRIBFLAG_COLOR)) == 0)
+		throw love::Exception("Mesh must have an enabled VertexPosition or custom attribute to be drawn.");
 
 	Graphics::TempTransform transform(gfx, m);