Просмотр исходного кода

Enable access to material's textures as discussed in PR #190

Maugre 4 лет назад
Родитель
Сommit
542147ba97
2 измененных файлов с 12 добавлено и 0 удалено
  1. 6 0
      material/material.go
  2. 6 0
      texture/texture2D.go

+ 6 - 0
material/material.go

@@ -375,3 +375,9 @@ func (mat *Material) TextureCount() int {
 
 	return len(mat.textures)
 }
+
+// Textures returns a slice with this material's textures
+func (mat *Material) Textures() []*texture.Texture2D {
+
+	return mat.textures
+}

+ 6 - 0
texture/texture2D.go

@@ -142,6 +142,12 @@ func (t *Texture2D) Dispose() {
 	}
 }
 
+// TexName returns the texture handle for the texture
+func (t *Texture2D) TexName() uint32 {
+
+	return t.texname
+}
+
 // SetUniformNames sets the names of the uniforms in the shader for sampler and texture info.
 func (t *Texture2D) SetUniformNames(sampler, info string) {