Parcourir la source

Merge pull request #225 from maugre/texture-funcs

Enable access to material's textures as discussed in PR #190
Daniel Salvadori il y a 4 ans
Parent
commit
f09c3af521
2 fichiers modifiés avec 12 ajouts et 0 suppressions
  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

@@ -143,6 +143,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) {