Working on mats&textures+better release handling+readme

This commit is contained in:
bloeys
2021-11-19 17:29:01 +04:00
parent 32c5def787
commit 3b31e8d677
4 changed files with 118 additions and 9 deletions

View File

@ -1,6 +1,32 @@
package asig
/*
#cgo CFLAGS: -I .
#cgo LDFLAGS: -L ./libs -l assimp_windows_amd64 -l IrrXML_windows_amd64 -l zlib_windows_amd64
#include <stdlib.h> //Needed for C.free
#include <assimp/scene.h>
//Functions
unsigned int aiGetMaterialTextureCount(const struct aiMaterial* pMat, enum aiTextureType type);
enum aiReturn aiGetMaterialTexture(
const struct aiMaterial* mat,
enum aiTextureType type,
unsigned int index,
struct aiString* path,
enum aiTextureMapping* mapping,
unsigned int* uvindex,
ai_real* blend,
enum aiTextureOp* op,
enum aiTextureMapMode* mapmode,
unsigned int* flags);
*/
import "C"
type Material struct {
cMat *C.struct_aiMaterial
/** List of all material properties loaded. */
Properties []*MaterialProperty
@ -38,3 +64,7 @@ type MaterialProperty struct {
*/
Data []byte
}
func GetMaterialTextureCount(m *Material, texType TextureType) int {
return int(C.aiGetMaterialTextureCount(m.cMat, uint32(texType)))
}