# ID3D10Device::RSSetState to be called every frame?

I am trying to create a ID3D10RasterizerState with direct3D10, and then call

ID3D10Device::RSSetState() with the proper information. However, whenever the window get rescaled, or when the app goes fullscreen, the rasterizerstate seems to reset to the default state. I have tried to set the state with WM_SIZE messages, but awkwardly, nothing seems to happen...

It works properly when I call RSSetState() every frame, but that seems highly inefficient.

Does anyone know a solution to this? It seems to be poorly documented on msdn.

Code:

bool TestGameApp::InitGame()
{
D3D10_RASTERIZER_DESC desc;
desc.AntialiasedLineEnable = TRUE;
desc.CullMode = D3D10_CULL_NONE;
desc.DepthBias = 0;
desc.DepthBiasClamp = 0.0f;
desc.FillMode = D3D10_FILL_SOLID;
desc.FrontCounterClockwise = false;
desc.MultisampleEnable = true;
desc.ScissorEnable = FALSE;
desc.SlopeScaledDepthBias = 0.0f;

//...more code
}


WndProc:

switch( message )
{
case WM_SIZE:
{
break;
}
}