Random shuffling of elements in STL containers

Use stl algorithm random_shuffle. This function has two overloads, first version randomizes using it’s own version of random number generator, second function takes a custom random number generator from our side. [sourcecode language=”cpp”]void TestShuffle() {     typedef short VT;     typedef std::vector VTVector;     // Count of elements     const VTVector::size_type Size = 10;     […]
Continue reading…

 

Capturing mouse input

There are two functions which helps in capturing mouse input, it’s called SetCapture and ReleaseCapture and a helper function called GetCapture which returns a handle to the capture window associated with the current thread. If no window in the thread has captured the mouse, the return value is NULL. Why do we need to capture […]
Continue reading…