First your using Azorbix's GenerateTexture function which relies on a texture resource. Then here, when you are appearing to clarify what you said, your creating this color array in the middle of DIP without even manipulating it as a texture. I do see a SetTexture(&Red), and I'm not sure if your referencing it even before you created it O_O. I suggest that if you are going to use a color array like that, that you use "D3DXCreateTextureFromFileInMemory"
Originally Posted by ^...,^
and use it like so...
Leave that color array out as a global, then create these in your hooked present function, checking to make sure that your colors are null upon creation, then recreate it.
D3DXCreateTextureFromFileInMemory(pDevice, (LPCVOID)&bRed, 60, &texRed);
bRed should be in a header and then referenced.
P.S: Here is the GenerateTexture function (Credits to Azorbix from GD)
HRESULT GenerateTexture(IDirect3DDevice9 *pD3Ddev, IDirect3DTexture9 **ppD3Dtex, DWORD colour32)
if( FAILED(pD3Ddev->CreateTexture(8, 8, 1, 0, D3DFMT_A4R4G4B4, D3DPOOL_MANAGED, ppD3Dtex, NULL)) )
WORD colour16 = ((WORD)((colour32>>28)&0xF)<<12)
(*ppD3Dtex)->LockRect(0, &d3dlr, 0, 0);
WORD *pDst16 = (WORD*)d3dlr.pBits;
for(int xy=0; xy < 8*8; xy++)
*pDst16++ = colour16;