728x90

Windows에서 할 일 


CreateWindow()를 한 이후에 SetLayeredWindowAttributes()를 호출 할 것.


WS_EX_LAYERED를 꼭 넣어야 한다.


DWORD dwWindowStyle = WS_POPUPWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS;

hWnd = CreateWindow(this->m_lpszTitle, this->m_lpszTitle, dwWindowStyle,

  nStartX, nStartY, nWidth, nHeight, NULL, NULL, hInstance, NULL);


if (!hWnd)

{

    return FALSE;

}

 

::SetWindowLong(hWnd, GWL_EXSTYLE, ::GetWindowLong(hWnd, GWL_EXSTYLE) | WS_EX_LAYERED | WS_EX_TOPMOST);

::SetWindowPos(hWnd, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);

::SetLayeredWindowAttributes(hWnd, 0x0000ff00, 255, LWA_COLORKEY);





DirectX9에서 할 일


CreateOffscreenPlainSurface()로 Surface를 생성.


Clear()를 할 때에는 SetLayeredWindowAttributes()에서 지정한 색상으로 할 것.


Present() 사용하지 말 것.


BitBlt()을 이용하여 윈도우 DC에 RenderTarget DC를 그릴 것.


소스 코드 : 

Banner_dx9_test.zip


728x90

+ Recent posts