// Error checking code removed for brevity. All are successful.
Direct3DDevice9->Clear( 0, 0, D3DCLEAR_TARGET, D3DCOLOR_XRGB(255,0,0), 1.0f, 0 );
Direct3DDevice9->BeginScene();
Direct3DDevice9->EndScene();
Direct3DDevice9->Present(0, 0, 0, 0);
IDirect3DDevice9 creation code
IDirect3DDevice9* Direct3DDevice9Raw(nullptr);
D3DPRESENT_PARAMETERS PresentationParameters;
ZeroMemory(&PresentationParameters, sizeof(D3DPRESENT_PARAMETERS));
PresentationParameters.Windowed = TRUE;
PresentationParameters.SwapEffect = D3DSWAPEFFECT_DISCARD;
PresentationParameters.BackBufferFormat = D3DFMT_UNKNOWN;
Result = Direct3D9->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, WindowHandle, D3DCREATE_HARDWARE_VERTEXPROCESSING, &PresentationParameters, &Direct3DDevice9Raw);
if(Result != D3D_OK)
{
return -1;
}
The desired effect would be the child window would appear red, but I wasn't seeing anything. Everything had been initialized successfully. After some fiddling around, I discovered the culprit. My parent form uses the WS_EX_COMPOSITED extended window style. When i removed this, my red box shows up. Does anyone know if there is a way to get this to work, while keeping WS_EX_COMPOSITED on the parent form?