What should I use to load textures? I've been loading a texture with this:
Will al_get_d3d_system_texture accomplish the same thing? I'm still learning how everything works and I noticed allegro had a texture loading function.
Allegro will load textures for you. It has to create 2 different textures:
The system texture is like a backup. It's kept in system memory, not on the gpu. It's never drawn, only copied to. When the video texture changes, the system texture is made up to date with it.
The video texture is what you draw and draw to. It's kept in memory on the gpu. GPU memory can be "lost" (a really annoying DirectX "feature") in which case the video texture has to be refreshed from the system texture.
I think what you want is al_get_d3d_video_texture, but it's hard to tell what you plan on doing with it.
I'm trying to apply the texture to this model.
void Render() { D3dDevice->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(0, 0, 0), 1.0f, 0); for(int i = 0; i < (int)Tiger.NumMaterials; i++) { D3dDevice->SetMaterial(&Tiger.MeshMaterials[i]); D3dDevice->SetTexture(0, Tiger.MeshTextures[i]); Tiger.Mesh->DrawSubset(i); } al_flip_display(); }
I dont think its working right the model doesnt look right. Does the al_get_d3d_video_texture function do the mat3d3 and ambient stuff?
No, it just gives you a texture, it has no knowledge mof materials or anything. If you're trying to texture something then you want the video texture not the system texture.
So like this?
Its still not showing up. Is there something else I have to do? I used the tutorial from msdn and their code was very similar and the texture showed up.
I have no clue how to use all of that d3dx stuff. The only guess I can make is somethings wrong with your light source.