Original Post
I'm working on a new framework currently, and I've ran into a problem with the device. It seems that even though the device is there, and its running the code, it doesn't want to clear the screen to a specified color. Here is what I have. Most likely its something simple I over looked. This here is my scene manager. The device is showing that it has a memory location, so figuring it loaded right. Also don't have any errors during runtime. This is how I create the device. Thanks for your time, Slyprid
void clsScene::Render()
{
switch(CurrentScene)
{
case 0:
dev->BeginScene();
dev->Clear(0, NULL, D3DCLEAR_TARGET | D3DCLEAR_ZBUFFER, D3DCOLOR_XRGB(255,0,0), 1.0f, 0);
dev->EndScene();
dev->Present(NULL,NULL,NULL,NULL);
break;
case 1:
break;
case 2:
break;
case 3:
break;
}
};
//--------------------------------------------------------------------------------------
// Create DX Device
//--------------------------------------------------------------------------------------
IDirect3DDevice9 *CreateDXDevice(bool bWindowed)
{
HRESULT hr;
ZeroMemory( &d3dpp, sizeof(d3dpp) );
d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD;
d3dpp.BackBufferFormat = D3DFMT_UNKNOWN;
d3dpp.AutoDepthStencilFormat = D3DFMT_D16;
d3dpp.BackBufferCount = 1;
d3dpp.BackBufferWidth = winWidth;
d3dpp.BackBufferHeight = winHeight;
d3dpp.hDeviceWindow = hWnd;
d3dpp.Windowed = bWindowed;
if(FAILED(dxInterface->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, &d3dpp, &device)))
{
if(FAILED(dxInterface->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, hWnd, D3DCREATE_SOFTWARE_VERTEXPROCESSING, &d3dpp, &device)))
{
MessageBox(NULL, L"DirectX Device creation failure!", L"Error", MB_OK);
return false;
}
}
SetRenderStates();
SetCamera();
return device;
};