Texture is not protected. using last loaded texture.

Started by
0 comments, last by Evil Steve 16 years, 7 months ago
hey. when i load my vertexbuffer whit one texture and lets say we load the "blue.jpg" picture and then i create a new class and do a new commando for the vertexbuffer initalation and then i set it whit the "red.jpg" picutre. both of them will get the Red picture or the last one wrote on the command. in my vertex class i have set the LPDIRECT3DVERTEXBUFFER9 Device under Private. and the LPDIRECT3DTEXTURE9 under protected. and still it aint working. help is needed.
Advertisement
The texture has nothing to do with the vertex buffer at all. You need to set one vertex buffer and texture, draw vertices, then change the texture (and vertex buffer if you need to) and draw more vertices. The texture isn't referenced by the VB in any way.

The "private" and "protected" modifiers don't change the data at all, they just mean that various other classes can't access that particular instance of the variable.

This topic is closed to new replies.

Advertisement