Jump to content
  • Advertisement

Archived

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

Goodlife

D3D Textures

This topic is 6694 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

Hi all, I have written a small routine to display tooltips over my game. What it does this this: I blit text to a texture surface I alpha-fade that texture in, over my main surface. ... Then... I fade it out when the player moves the cursor. It makes for a nice, fancy tooltip. And it worked great on my ATI Rage video card. Then I tried it on a Creative Labs card. Well, the text appeared okay, but it wouldn''t fade in-- it always existed fully opaque. Meanwhile, the texture I was using as the ''black box'' around the text faded in fine. I puttered around a bit, and I realized I had not declared that surface with the text on it was a ''texture.'' So I did that. NOW, on the computer that it previously worked on (ATI Rage), it pauses HORRIBLY when I blt text to the surface. I''m talking about a second to blt twenty characters. And, on the Creative Labs card, blitting doesn''t seem to work at all-- I use normal Direct3d Blt commands, but everything is skewed as though the pitch of the surface has gotten fouled somewhere. So, my questions are: Is it ''techinically'' illegal to blit to a texture? Even though it works on some cards? On the creative-labs card, I''ve had problems before when I tried to use surfaces called ''texture'' for anything but 3d work. Do I need to declare the surface to be texture AND something else? Anyone heard of this sort of thing? Why should it work on one card but not another? I thought the whole point of D3D was to establish a standard?! -- Goodlife ----------------------------- Think of your mind as a door on a house. Leave the door always closed, and it's not a house, it's a prison. Leave the door always open, and it's not a house, it's a wilderness-- all the vermin creep in.

Share this post


Link to post
Share on other sites
Advertisement
not so sure, but i think both source and dest need to be textures, then you Unload the texture, Lock it, copy data over, Unlock it, and Load it again.
along with having DDSCAPS_ALLOCONLOAD set in the dest surface.
that''s how it worked for me under DX5 (i think). i''ve never tried it with 6 or 7.



crazy166
some people think i'm crazy, some people know it

Share this post


Link to post
Share on other sites
Hmmm, that would put me in a quandry, because some of these ''textures'' (like the font) need to be blitted to the primary surface.

By the way, when I declare a surface a texture, it has a different format on some video cards. If I try to go in and plot it myself, I find that the surface memory is very strange, non-linear in some cases. A software blt that works fine on a non-textured surface appears as a SINGLE LINE on a textured surface. Could it be that textures are handled on this card as one HUGE picture, and when I try to add in the pitch of it, I actually just go further right?

Anyone know if this is so, or, if not, what the heck else it could be?

-- Goodlife

-----------------------------
Think of your mind as a door on a house. Leave the door always closed, and it's not a house, it's a prison. Leave the door always open, and it's not a house, it's a wilderness-- all the vermin creep in.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!