Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void DrawEngine::drawBlock(int x, int y, COLORREF color)
- {
- HBRUSH hBrush = CreateSolidBrush(color);
- rect.left = x;
- rect.right = x + 1;
- rect.top = y;
- rect.bottom = y + 1;
- FillRect(hdc, &rect, hBrush);
- MoveToEx(hdc, x, y + 1, NULL);
- LineTo(hdc, x, y);
- LineTo(hdc, x + 1, y);
- DeleteObject(hBrush);
- }
- void DrawEngine::drawInterface()
- {
- HBRUSH hBrush = CreateSolidBrush(RGB(70,70,70));
- rect.top = height;
- rect.left = width;
- rect.bottom = 0;
- rect.right = width + 8;
- FillRect(hdc, &rect, hBrush);
- DeleteObject(hBrush);
- }
- void DrawEngine::drawNextPiece(Piece &piece, int x, int y)
- {
- TCHAR szBuffer[] = TEXT("Next:");
- TextOut(hdc, x, y + 5, szBuffer, lstrlen(szBuffer));
- COLORREF color = piece.getColor();
- for (int i = 0; i < 4; i++)
- {
- for (int j = 0; j < 4; j++)
- {
- if (piece.isPointExists(i, j))
- drawBlock(i + x, j + y, color);
- else
- drawBlock(i + x, j + y, RGB(0,0,0));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement