Created
April 25, 2015 15:53
-
-
Save ebobtron/b59fa6b0518346d4591c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| This is just the beginning sorry I am so quick sometimes. | |
| I will always stop and discuss. Anytime. | |
| /** make the brick wall **/ | |
| void createWall(int x){ | |
| infobrick[0] = createBrick( 10, 10, 30, 10, bO_DDGRAY, bO_RED); | |
| } | |
| /** make a brick **/ | |
| tHEBRICK createBrick(int x, int y, int length, int height, | |
| COLORREF pen, COLORREF brush){ | |
| tHEBRICK abrick; | |
| abrick.pen = pen; | |
| abrick.brush = brush; | |
| abrick.rcBrick.left = x; | |
| abrick.rcBrick.top = y; | |
| abrick.rcBrick.right= x + length; | |
| abrick.rcBrick.bottom = y + height; | |
| return abrick; | |
| } | |
| /** drawwall code I am experimenting with **/ | |
| /** note: it will only draw the frist brick **/ | |
| void drawWall(HDC hdc){ | |
| COLORREF lastpen = NULL; | |
| COLORREF lastbrush = NULL; | |
| SelectObject(hdc, GetStockObject(DC_PEN)); | |
| SelectObject(hdc, GetStockObject(DC_BRUSH)); | |
| lastpen = SetDCPenColor(hdc, infobrick[0].pen); // pen and brush come from global array infobrick[] | |
| lastbrush = SetDCBrushColor(hdc, infobrick[0].brush); | |
| Rectangle(hdc, // rectangle comes from global array infobrick[] | |
| infobrick[0].rcBrick.left, // int nLeftRect | |
| infobrick[0].rcBrick.top, // int nTopRect | |
| infobrick[0].rcBrick.right, // int nRightRect | |
| infobrick[0].rcBrick.bottom); // int nBottomRect | |
| SetDCPenColor(hdc, lastpen); | |
| SetDCBrushColor(hdc, lastbrush); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I was going to use RECT* , like paddle, without the moving part, so is it a bad idea or go for a nested for lines/rows changing color for each line(that's a detail)?