I have a simple level editor (incomplete) that I'm making for a maze I'm making in Visual C++ (in OpenGL).

Right now, I am up to the point where I can make lines appear (Will someday be walls!), but they are very unorderly, and there would be holes all over my map.

I've attached (I think I did, I've never attached a file before) my maze, so you can see what I'm trying to do. I want to know how I could make it snap onto the grid (Right now its just a bunch of blue lines).

Help would be very appreciated