• Advertisement

Archived

This topic is now archived and is closed to further replies.

Texture switching problem

This topic is 5489 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have a strange texture problem, but I''m not sure where to look to fix it. It looks almost like im doing multi-texturing by accident.. Heres the situation: I want to render my map with a texture, and each tile having its own UV coordiantes. Works perfectly. I create a font class, and , just to test it, When I call font draw, I mafde it draw the entire texture. Again, this works fine. The problem is when I try to render the map first, then the font. What happens is that the map gets rendered fine, then I change the texture, render it fine, and then, for some odd reason, the ENTIRE tileset texture gets rendered as well, behind everything else! I scrolled my map around, and when it goes out of the screen, and just the font texture is rendering, the tileset texture behind it goes away. As soon as even a small portion of the map comes back into the screen however, the tileset renders itself again. Heres a summary of the calls I make:
	ManagerPtr pTilesetMan = RequestManager(4);
	CTileset *pTileset = 0;
	pTileset = static_cast(pTilesetMan->RequestAsset(0));
	assert(pTileset != 0);

	pDirect3D->GetDevice()->SetTexture(0, pTileset->GetTexture()->GetTexture());
	pMap->Render();
	pVb->ForceDraw();

	ManagerPtr TexMan = RequestManager("TEXTURE");
	CTexture *pTex = static_cast(TexMan->RequestAsset(2));
	pDirect3D->GetDevice()->SetTexture(0, pTex->GetTexture());

	pFont->Draw();
	pVb->ForceDraw();
 
Basically it should render the map with the tileset texture, then render the font texture on top of it. Thats it. But it adds that annoying entire tileset texture one under both the font and the map. Am I multi-texturing or something by accident? what else could it be? I also tried calling SetTexture to (0, NULL) between switching the textures and nothing happens. Any help would be greatly appreciated!

Share this post


Link to post
Share on other sites
Advertisement
Should I post a screenshot to show? After re-reading it, i admit my description is a little odd and hard to follow..

Share this post


Link to post
Share on other sites

  • Advertisement