Game Development Reference
In-Depth Information
Figure 2.1 PolyDraw Sample drawing lines.
0, // Source y
m_width, // Source width
m_height, // Source height
m_bits, // Pointer to bits
m_bmi, // BITMAPINFO
DIB_RGB_COLORS, // Options
// Raster operation code (ROP)
So that is it for the Windows stuff. Now we can get down to the actual
Drawing a line with Bresenham's algorithm
We now have in memory a BYTE buffer. We can draw on this by setting
the RGB values at a particular memory location. For convenience, the
class includes a private function GetPixelAddress(x, y ), which returns a
Search Nedrilad ::

Custom Search