   [DX10] ID3DX10Sprite and sampler states
  Is it possible to set custom sampler states when using ID3DX10Sprite? I would like to change AddressU and AddressV to D3D10_TEXTURE_ADDRESS_WRAP, so that I can tile a texture for a background.However, setting my custom sampler state does not seem to have any effect. When examining the DX calls using PIX, it looks like ID3DX10Sprite keeps setting its own sampler state.Does anyone have any ideas, or will I have to write my own version?Thanks.   
  I found a really bad temporary solution:1) I call DrawSpritesImmediate with a zero'd D3DX10_SPRITE, so that it sets the sampler state2) I call PSGetSamplers to get the sampler state used by ID3DX10Sprite3) I release that state4) I memcpy my own state that wraps texture coordinates to where that state was (I use a size of 40 because if it is any higher, PIX starts crashing)(However, when viewing the frame renders in PIX, it still appears to use CLAMP instead of WRAP)ID3D10SamplerState* sampler;D3DX10_SPRITE spr;ZeroMemory(&spr, sizeof(spr));_sprite->Begin(D3DX10_SPRITE_SAVE_STATE);_sprite->DrawSpritesImmediate(&spr, 1, 0, 0);_device->PSGetSamplers(0, 1, &sampler);_sprite->End();sampler->Release();memcpy(sampler, _samplerState, 40);So obviously I would prefer not to use this solution. Are there any other ideas? If I do have to write something to replace ID3DX10Sprite, maybe I can at least pull the shaders, etc. from it.Thanks.   ;  Yeah I don't think it's possible, unfortunately. If you want a replacement, I wrote a SpriteRenderer class for my D3D11 sample framework. You can get it from one of my recent samples, like this one. It should be trivial to convert it to D3D10.   ;  Thanks. I might give that a go sometime. For now, I've created a class that creates a D3DX10Sprite, grabs all the shaders, etc, and then releases the D3DX10Sprite. It has methods that work similarly to the ones in D3DX10Sprite, and uses its shaders and other resources.-Jeff[Edited by - jrh2365 on June 9, 2010 10:51:34 PM]