Jump to content
  • Advertisement
Sign in to follow this  
Defend

How do I build/implement a bitmask?

This topic is 5175 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 keep getting stuck, getting half inspired, then getting stuck and leaving it again. My aim is to basically create a swept-area collision detection routine, as shown here. I'd be checking the entire grey + blue + dark blue area against the tiles with dark brown in them. I don't know the general gist of doing bitmasking in the first place, and these questions come to mind: 1. Can I create and store a 1-bit bitmap? Because I only want each pixel to have a yes/no value. 2. Can I do this in Direct3D, or do I need some other library? So far I've got pretty things that move and spin, using D3D. 3. If the surface is built from those 1-bit tiles, how do I pluck out a specific tile and prepare it for bitmask testing? 4. Can I create a dynamic bitmask on the fly? For example, the grey rectangle, or one tile-bounded piece of the grey rectange. I don't know how much sense those questions make, but thanks for any replies.

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by Defend
1. Can I create and store a 1-bit bitmap? Because I only want each pixel to have a yes/no value.
Yes, there are monochrome bitmaps.

Quote:
3. If the surface is built from those 1-bit tiles, how do I pluck out a specific tile and prepare it for bitmask testing?
You can't really, but if you put the tile, you should be able to calculate where that tile is.

Quote:
4. Can I create a dynamic bitmask on the fly? For example, the grey rectangle, or one tile-bounded piece of the grey rectange.
I've never used DirectX, so I can't tell you, look at the converting function and see if they dither.

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!