Jump to content
  • Advertisement
Sign in to follow this  
Kr00pS

Modify a texture by pixels

This topic is 3833 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 want to implement explosives weapons in my game like C4. To draw my map, I'm using the ID3DXSprite interface with one texture (which contains tiles : grass, wall etc). To be more realistic, I want that the wall could be destructible by pixels not by tiles (not like bomberman). So, for destructible objects in the game, I will create a class which contains a texture (LPDIRECT3DTEXTURE9) and others properties. But I want to know how to modify a texture by pixels. Or if my method is wrong, how can I proceed ? Thanks for all !

Share this post


Link to post
Share on other sites
Advertisement
Printing an explosion decal over the terrain would actually be way faster than changing the color of the pixels one by one.

Share this post


Link to post
Share on other sites
Ok, but I don't see how to draw the decal only on the destructible objects. I mean, if there are others tiles around.



Thanks for the help :)

Share this post


Link to post
Share on other sites
Don't draw it over the object when on the screen. Draw it over the object in memory itself. Draw it over the texture, or the texture's alpha layer. (Or create a mask for it, and draw onto the mask)

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!