   about speed of rendering
  I have few classes to deal with objects and every class sets it''s owns renderstates, samplerstates, etc. I would like to ask if setting the same state after it has been previously set would slow down rendering, and how, ie:somewhere in code:pd3dDevice->SetSamplerState( 0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR );pd3dDevice->SetSamplerState( 0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR );and later next object set before rendering the same.Lemmy  
If you are using not a Pure device, then DirectX usually checks the states to see if they have already been set. So, setting up the same states later on wouldn''t be too much of a hit. There is however the extra overhead of calling the functions, then for DirectX to check each state - so it''s best to do some state management higher up in your code.I normally use a set of bitmasks to check a group of states and do a simple test before setting any of the states for the device, i.e:   void RENDERER::SetTextureTiled(bool On){   // Set texture tiled state if required    if (On)   { // Check if it''s not already set if (!(m_RenderState & RS_TEXTURE_TILED)) {g_pD3DDev->SetTextureStageState(0, D3DTSS_ADDRESSU,D3DTADDRESS_WRAP );g_pD3DDev->SetTextureStageState(0, D3DTSS_ADDRESSV,D3DTADDRESS_WRAP );g_pD3DDev->SetTextureStageState(1, D3DTSS_ADDRESSU, D3DTADDRESS_WRAP );g_pD3DDev->SetTextureStageState(1, D3DTSS_ADDRESSV,D3DTADDRESS_WRAP );m_RenderState |= RS_TEXTURE_TILED; }   }   else   { // Check if it already set if (m_RenderState & RS_TEXTURE_TILED) { g_pD3DDev->SetTextureStageState(0,  D3DTSS_ADDRESSU,   D3DTADDRESS_CLAMP ); g_pD3DDev->SetTextureStageState(0, D3DTSS_ADDRESSV,   D3DTADDRESS_CLAMP );    g_pD3DDev->SetTextureStageState(1, D3DTSS_ADDRESSU, D3DTADDRESS_CLAMP );    g_pD3DDev->SetTextureStageState(1, D3DTSS_ADDRESSV,   D3DTADDRESS_CLAMP ); m_RenderState &= ~RS_TEXTURE_TILED; }   }}  If you are using a pure device, then no checking is done in directX - therefore it is all upto you. If you want to see a working example of this, you can download the source code for the Afro-santa game and have a look in renderer.cpp (In the afroengine project) :http://www.afrohorse.com/demos/afrosanta/afrosanta.htmlHope that helps, =============================All Animals should have afroshttp://www.afrohorse.com=============================  ;  Thanks for response, that helped a lot.Lemmy  