Jump to content
  • Advertisement


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


Draw to a texture help

This topic is 6493 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, I have been working on a menu system, which involves taking sections of a PCX & drawing them over the top of a texture in texture memory. I had it working nicely at home (Viper2) using the TEXTURE_P_8 format, just copying the new data in as same format, but my machine at work (Matrox G400) either doesn''t support P8 Textures, or I am doing something wrong. The texture seems to be reverting to the TEXTURE_RGB_565 format, which of course means anything I draw to it looks like crap. Anyone managed to get the above sort of thing working nicely? ie Copying data to a texture. Cheers Darrin

Share this post

Link to post
Share on other sites
Ah the joys of DirectX and different hardware

If you want it to work on every card, you must get the pixel format of the surface you''re drawing on and convert the colors to that format.

You can''t rely on 8 bit texture support. It''s not even safe to assume RGB 565. Some cards have RGB 555 and the bit order could be different.

Look in \examples\lightmap\lmaputil.c for a function called GetRGBInfo for an idea how to get and use the pixel format information.

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!