Directx 9 crashes when starting another program with administrator privilege

88 Views Asked by At

i don't know how to explain exactly. i upgrade my game from directx 8 to 9. normally there is no problem, but when you start a program with admin authority, textures is corrupted. any app.

before https://pasteboard.co/vGJXHOliVKaU.png

after: https://pasteboard.co/JRQBq3cLuCQu.png

terrain render code

bool isFirst=true;
for (DWORD j = 1; j < pTerrain->GetNumTextures(); ++j)
{
    TTerainSplat & rSplat = rTerrainSplatPatch.Splats[j];
    if (!rSplat.Active)
        continue;

    if (rTerrainSplatPatch.PatchTileCount[sPatchNum][j] == 0)
        continue;

    const TTerrainTexture & rTexture = m_TextureSet.GetTexture(j);

    D3DXMatrixMultiply(&matSplatColorTexTransform, &m_matViewInverse, &rTexture.m_matTransform);
    STATEMANAGER.SetTransform(D3DTS_TEXTURE0, &matSplatColorTexTransform);
    if (isFirst)
    {
        STATEMANAGER.SetTextureStageState(1, D3DTSS_ALPHAOP,   D3DTOP_DISABLE);
        STATEMANAGER.SetTexture(0, rTexture.pd3dTexture);
        STATEMANAGER.SetTexture(1, rSplat.pd3dTexture);
        STATEMANAGER.DrawIndexedPrimitive(ePrimitiveType, 0, m_iPatchTerrainVertexCount, 0, wPrimitiveCount);
        STATEMANAGER.SetTextureStageState(1, D3DTSS_ALPHAOP,   D3DTOP_SELECTARG1);
        isFirst=false;
    }
    else
    {
        STATEMANAGER.SetTexture(0, rTexture.pd3dTexture);
        STATEMANAGER.SetTexture(1, rSplat.pd3dTexture);
        STATEMANAGER.DrawIndexedPrimitive(ePrimitiveType, 0, m_iPatchTerrainVertexCount, 0, wPrimitiveCount);
    }
}
0

There are 0 best solutions below