Thread overview
D with DerelictASSIMP3 question
Feb 02, 2016
WhatMeWorry
Feb 02, 2016
Maeriden
Feb 02, 2016
Mike Parker
February 02, 2016
I'm porting a C++/opengl/AssImp tutorial over to D/DerelictOpenGL/DerelictAssImp
but have hit a brick wall.

It's a fairly large project but a tiny fragment suffices:

if(mesh.mMaterialIndex >= 0)
{
    const aiMaterial* material = scene.mMaterials[mesh.mMaterialIndex];
    // uint texCount = material.GetTextureCount(aiTextureType_SPECULAR);


Everything compiles fine.


But when I uncomment the call to GetTextureCount(), the Visual Studio D compiler comes back with:

ModelClass.d(165): Error: no property 'GetTextureCount' for type 'const(aiMaterial*)'

I looked at AssImp documentation at

http://assimp.sourceforge.net/lib_html/structai_material.html

And it shows

unsigned int 	GetTextureCount (aiTextureType type) const
Get the number of textures for a particular texture type.

So it seems like such a simple error, but I've been stuck for days. Any suggestions?

February 02, 2016
On Tuesday, 2 February 2016 at 02:57:14 UTC, WhatMeWorry wrote:
> I'm porting a C++/opengl/AssImp tutorial over to D/DerelictOpenGL/DerelictAssImp
> but have hit a brick wall.
>
> [...]

Try aiGetMaterialTextureCount.
I'm guessing derelict uses the C API as much as it can.
February 02, 2016
On Tuesday, 2 February 2016 at 03:22:16 UTC, Maeriden wrote:
>
> Try aiGetMaterialTextureCount.
> I'm guessing derelict uses the C API as much as it can.

It uses the C API exclusively.