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"
and use it like so...
Code:
LPDIRECT3DTEXTURE9 texRed;
D3DXCreateTextureFromFileInMemory(pDevice, (LPCVOID)&bRed, 60, &texRed);
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.
bRed should be in a header and then referenced.
P.S: Here is the GenerateTexture function (Credits to Azorbix from GD)
Code:
HRESULT GenerateTexture(IDirect3DDevice9 *pD3Ddev, IDirect3DTexture9 **ppD3Dtex, DWORD colour32)
{
if( FAILED(pD3Ddev->CreateTexture(8, 8, 1, 0, D3DFMT_A4R4G4B4, D3DPOOL_MANAGED, ppD3Dtex, NULL)) )
return E_FAIL;
WORD colour16 = ((WORD)((colour32>>28)&0xF)<<12)
|(WORD)(((colour32>>20)&0xF)<<8)
|(WORD)(((colour32>>12)&0xF)<<4)
|(WORD)(((colour32>>4)&0xF)<<0);
D3DLOCKED_RECT d3dlr;
(*ppD3Dtex)->LockRect(0, &d3dlr, 0, 0);
WORD *pDst16 = (WORD*)d3dlr.pBits;
for(int xy=0; xy < 8*8; xy++)
*pDst16++ = colour16;
(*ppD3Dtex)->UnlockRect(0);
return S_OK;
}