Archived

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

mcfc98

multiple texture formats

Recommended Posts

Im writing something that will need to use all sorts of bit-depths for the textures in DX7 (including palettized). I can create all the surfaces fine and draw them independantly of each other, but when i mix, say a 24bit texture with a 565 texture the images go garbled (wrong dimensions, position - everything!!). Its only when they are both visible on the screen that this happens. I assume this is something to do with the texture management of directx cos when i create one of the surfaces without the texturemanage flag then everything draws fine and in the right dimensions except the one i create without the texmanage flag (which is fine apart from it has no texture - its just a white image). Does anyone know why this happening for sure and have any ideas how to get round it? Im using a TNT2 card btw.

Share this post


Link to post
Share on other sites
Remember, with each color depth the lPitch in a surface will be different and should be taken into account. Using textures of different color depths requires run-time color conversion to be done. Check to see that you''re doing both of the above stated, it''s probably the source of your headaches.

-Cicco

Share this post


Link to post
Share on other sites
Done all that - the texture surfaces are all there created properly - as i said i can draw them independantly of each other and they are fine - mix them up and it goes tits up!

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
It''s a strange problem, and I can only suggest making sure your textures are created in video memory.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
If you are trying to display two textures on one surface, both textures must match the surfaces bit depth and pitch. To make this happen you must convert either texture to the other texture''s bit depth/pitch and make sure this matches the surface. For example: you have a 24 bit texture and a 565 texture, you quantize the 565 tex to 24 bit and then draw both textures into a 24bit surface at the proper resolution. This does work. With or without texture management.

--Cauldron the Terrible

Share this post


Link to post
Share on other sites