Require material textures to be 2D;

This commit is contained in:
bjorn 2021-06-12 14:25:09 -06:00
parent 3d1775e468
commit 82b7632cea
1 changed files with 1 additions and 0 deletions

View File

@ -89,6 +89,7 @@ Texture* lovrMaterialGetTexture(Material* material, MaterialTexture textureType)
void lovrMaterialSetTexture(Material* material, MaterialTexture textureType, Texture* texture) {
if (material->textures[textureType] != texture) {
lovrAssert(lovrTextureGetType(texture) == TEXTURE_2D, "Material textures must be 2D");
lovrGraphicsFlushMaterial(material);
lovrRetain(texture);
lovrRelease(material->textures[textureType], lovrTextureDestroy);