Skip to main content
gamedev.net
🔒 Locked

Have Problem in SetTexture function?

Started by keroz Jan 23, 2004 at 3:02 AM 2 replies 350+ views
Original Post
keroz
keroz
I create and Render Mesh by ID3DXMesh and DrawSubset() numMesh = 120; for(int i=0;iSetTexture(0,texture); mesh[i].DrawSubset(0); } I set numMesh = 130 Speed is drop from 80 fps to 1 fps I think it happen becaus SetTexture function in for Loop if i want to set many Texture to many mesh in same screen how to manage it
ProtoPornoPants
ProtoPornoPants
Yes, this is a very bad way to do things.

A much better way to do this is to sort your meshes by texture. Set the texture once for the meshes you are about to draw, then draw them, then change to the next texture and draw the meshes for that texture.
keroz
keroz
Tank you But,
what is best way for set texture by DirectX ?

ProtoPornoPants
ProtoPornoPants
SetTexture() is the only way to set textures using DirectX. There is no faster way (at least on windows platforms).

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.