|
if (::GetAsyncKeyState(0x31) & 0x8000f)
{
g_D3DDevice->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_WRAP);
g_D3DDevice->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_WRAP);
}
if (::GetAsyncKeyState(0x32) & 0x8000f)
{
g_D3DDevice->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_MIRROR);
g_D3DDevice->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_MIRROR);
}
if (::GetAsyncKeyState(0x33) & 0x8000f)
{
g_D3DDevice->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
g_D3DDevice->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);
}
if (::GetAsyncKeyState(0x34) & 0x8000f)
{
g_D3DDevice->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_BORDER);
g_D3DDevice->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_BORDER);
}
//......................................................
g_D3DDevice->SetTexture(0,g_texture);
g_D3DDevice->SetStreamSource(0,vertexbuffer,0,sizeof(vertex));
g_D3DDevice->SetFVF(vertex::fvf_flags);
g_D3DDevice->DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2);
我弄的是一个正方形(正方形够大),纹理是出来了,但整张纹理平铺在上面,不能实现各种寻址模式改变,单改也不行,比如我想用重复寻址也不行,求解! |
|