   SImple D3D Question - Reuseable Surfaces
  I'm making a simple tile-based game. The tiles are loaded and stored in a surface. There can be more than one tile sets in my game, so I want my IDirect3DSurface8* to be reusable. I don't know the "standard" way of doing this, so I came up with a few. Tell me which ones would work, which ones wouldn't, and the one that is generally the best:// When the game is initialized:IDirect3DSurface8* m_pCurrectTileSurface;Device->CreateImageSurface( 256, 256, D3DFMT_X8R8G8B8, &m_pCurrentTileSurface );D3DXLoadSurfaceFromFile( m_pCurrentTileSurface, NULL, NULL, "TileSetOne.bmp", NULL, D3DX_DEFAULT, 0, NULL );// When the time comes to switch the tile setvoid SwitchTileSet( const char* NewTileSetFileName ){m_pCurrectTileSurface->Release();Device->CreateImageSurface( 256, 256, D3DFMT_X8R8G8B8, &m_pCurrentTileSurface );D3DXLoadSurfaceFromFile( m_pCurrentTileSurface, NULL, NULL, NewTileSetFileName, NULL, D3DX_DEFAULT, 0, NULL );return;}Now, my guess it's either the code above, or is there no need to release and recreate? Please post an example!   
  From what I can tell, that's the best way to do it.  Calling Release() will ensure that you clean up before recreating the surface and reloading the image.  While the image is the same size, I've found no indication in the docs as to whether D3DXLoadSurfaceFromFile() will overwrite an existing surface or not (aside from some mention of mipmap levels).Look at the docs for D3DXLoadSurfaceFromFile() and it will mention using AddDirtyRect().  This MAY be applicable in your case but likely not.Unless your needs are weird, you should be just fine with what you're doing.-Auron   