help how to make polygon

This is a discussion on help how to make polygon within the C++ Programming forums, part of the General Programming Boards category; plz tell how to write the program for filling a polygon in electronic fashion and u may fill it with ...

1. help how to make polygon

plz tell how to write the program for filling a polygon in electronic fashion and u may fill it with pixel and first generate a polygon as shown below then fill the polygon, all slope lines are 45 degrees.

__________________
| |
| |
| |
| |
| |
| |
| /\ |
| / \ |
| / \ |
| / \ |
| / \ |
| / \ |
|/ \ |
\ |
\ |
\ |
\ |
\ |
\ |
\ |
\ |
\ |
\ |
\ |
\ |
\|

2. > how to write the program for filling a polygon

type in
polygon fill algorithm

3. Sorry hun, this belongs more to the world of OpenGL.

4. Using Win32 primitive drawing, you could use this function:

BOOL Polygon(HDC, hDC, CONST POINT* pt, int iCount);

All you have to do, is to fill an array with points.. and it will connect them for you.

Code:
```void GamePaint(HDC hDC)
{
POINT points[3];
points[0] = { 5, 10};
points[1] = {25, 30};
points[2] = {15, 20};
Polygon(hDC, points, 3);
}```