WIN32 - 8BitsCoding/RobotMentor GitHub Wiki
์ ๋ฐ์ ์ค๋ช ์ฌ์ดํธ
- Windows ๋ฐ์คํฌํฑ ์์ฉ ํ๋ก๊ทธ๋๋ฐ Step 2 : ํ๋ก์ ํธ ์์ฑ/์ ๋ฆฌ ํ๊ธฐ
- Windows ๋ฐ์คํฌํฑ ์์ฉ ํ๋ก๊ทธ๋๋ฐ Step 3 : ๋ง์ฐ์ค ํด๋ฆญ ๋ฐ์์ ๋ค๋ชจ, ์ ๊ทธ๋ฆฌ๊ธฐ
- Windows ๋ฐ์คํฌํฑ ์์ฉ ํ๋ก๊ทธ๋๋ฐ Step 4 : ๋ง์ฐ์ค๋ฅผ ํด๋ฆญํ ์ํ์์ ์ด๋ํ๋ฉด ๊ณ์ ๊ทธ๋ ค์ง๊ฒ ๋ง๋ค๊ธฐ
- Windows ๋ฐ์คํฌํฑ ์์ฉ ํ๋ก๊ทธ๋๋ฐ Step 5 : WM_PAINT ์ด์ฉ๋ฒ
- Windows ๋ฐ์คํฌํฑ ์์ฉ ํ๋ก๊ทธ๋๋ฐ Step 6 : ๋ค๋ชจ ๋ง์ฐ์คํด๋ฆญ์ผ๋ก ์์ง์ด๊ธฐ
- Windows ๋ฐ์คํฌํฑ ์์ฉ ํ๋ก๊ทธ๋๋ฐ Step 7 : ๋ง์ฐ์คํด๋ฆญ์ ๋ชจ๋ํฐํ๋ฉด์ ๋ณต์ฌํด์ค๊ณ ์ถ๋ค.
์ถ๊ฐ. WM_CREATE, BitBlt ์ด์ฉ๋ฒ
์ง์ DC๋ฅผ ๋ง๋ค์ด ์ฌ์ฉ(CreateDC, CreateCompatableDC), GetWindowRect, ValidateRect
- Windows ๋ฐ์คํฌํฑ ์์ฉ ํ๋ก๊ทธ๋๋ฐ Step 9 : ํ๋๋ค๋ชจ ๊ทธ๋ฆฌ๊ธฐ, ์ ์ฌ๋ฌ ์ข ๋ฅ๋ก ์ถ๋ ฅํด๋ณด๊ธฐ
selectobject ์ ๋ํด์, CreatePen์ ๋ํด์
GetStockObject์ ๋ํด์, CreateSolidBrush์ ๋ํด์, CreateHatchBrush์ ๋ํด์
- Windows ๋ฐ์คํฌํฑ ์์ฉ ํ๋ก๊ทธ๋๋ฐ Step 11 : GDI Object๋ฅผ ์ข ๋ ํธํ๊ฒ ์ฌ์ฉํ๊ธฐ ์ํ ๋ฐฉ๋ฒ (์ค๋ชฉ ์์ ๋ง๋ค๊ธฐ)
SetDCBrushColor, SetDCPenColor์ ๋ํด์
- Windows ๋ฐ์คํฌํฑ ์์ฉ ํ๋ก๊ทธ๋๋ฐ Step 12 : ๋ง์ฐ์ค ํด๋ฆญ์ผ๋ก ๋ค๋ชจ ์์น ํ๊ธฐ
- Windows ๋ฐ์คํฌํฑ ์์ฉ ํ๋ก๊ทธ๋๋ฐ Step 13 : ๊ฐ ์ฌ๊ฐํ์ด ์์ ์ ํด๋ฆญ์ํ๋ฅผ ๊ธฐ์ตํ๋๋ก ์์ ํ๋ค.(+ ์ฝ๋ ๊ฐ๋จํ)
- Windows ๋ฐ์คํฌํฑ ์์ฉ ํ๋ก๊ทธ๋๋ฐ Step 14 : ์ค๋ชฉ ๊ทธ๋ฆฌ๊ธฐ ์์
- Windows ๋ฐ์คํฌํฑ ์์ฉ ํ๋ก๊ทธ๋๋ฐ Step 15 : TextOut, DrawText
- Windows ๋ฐ์คํฌํฑ ์์ฉ ํ๋ก๊ทธ๋๋ฐ Step 16 : ์๊ฐ์ ๋ฐ๋ผ ์ด๋ํ๋ ์ ๋ง๋ค๊ธฐ
Timer์ ๋ํด์,
- Windows ๋ฐ์คํฌํฑ ์์ฉ ํ๋ก๊ทธ๋๋ฐ Step 17 : Timer๋ฅผ ์ด์ฉํ์ฌ ๋์งํธ ์๊ณ๋ง๋ค๊ธฐ
- Windows ๋ฐ์คํฌํฑ ์์ฉ ํ๋ก๊ทธ๋๋ฐ Step 18 : Timer๋ฅผ ์ด์ฉํ์ฌ 100๊ฐ์ ์์ ๊ทธ๋ฆฌ๊ณ ์ถ์ํ๊ธฐ
- Windows ๋ฐ์คํฌํฑ ์์ฉ ํ๋ก๊ทธ๋๋ฐ Step 19 : 18๋ฒ ์์ ํ๋ฉด ๊น๋นก์ ์ ๊ฑฐ
CreateCompatibleDC, BitBlt์ ๋ํด์
- Windows ๋ฐ์คํฌํฑ ์์ฉ ํ๋ก๊ทธ๋๋ฐ Step 20 : ์๋์ฐ ๋ฉ์์ง๋ฅผ ์ด์ฉํ์ฌ ๋ฉ๋ชจ์ฅ์ ๊ธ ์ ๋ ฅํ๊ธฐ
- Windows ๋ฐ์คํฌํฑ ์์ฉ ํ๋ก๊ทธ๋๋ฐ Step 21 : ์นดํก๋ฐฉ์ ๋ฉ์์ง ๋ณด๋ด๊ธฐ
- Windows ๋ฐ์คํฌํฑ ์์ฉ ํ๋ก๊ทธ๋๋ฐ Step 22 : ์๋ํธ ํ ์คํธ๋ก ๋ฉ์์ง๋ฅผ ์ ๊ณ ์ ์ก๋ฒํผ์ผ๋ก ์นดํก๋ฉ์์ง ๋ณด๋ด๊ธฐ
- Windows ๋ฐ์คํฌํฑ ์์ฉ ํ๋ก๊ทธ๋๋ฐ Step 22 : ์ฌ๋ฌ ์นดํก๋ฐฉ์ ๋์์ ์ ์ก