Skip to main content
GameDev.net gamedev.net
🔒 Locked

Color Loss

Started by STRATERCAS Sep 29, 2005 at 2:15 AM 0 replies 500+ views
Original Post
STRATERCAS
STRATERCAS
I'm sort of unclear as to what the problem is here. I would say that there was a problem with the chroma key but even if I don't set a transparent color it fudges the color all up. It looks like it should when it's a surface but as soon as I load it as a texture it goes all dark on me. It looks like I'm losing just my Green Color Channel I included a screen shot to show what I'm talking about that. I'm rather Green when it comes to DirectX so is there something I'm missing when it comes to textures that's a common newbie error? Note: The texture is being used with LPD3DXSPRITE with DirectX9 if that makes any difference.
[source lang= c++]
int DXTEXTURE::D3DTextureLoad(LPDIRECT3DDEVICE9 myD3DDEV, char * file, D3DCOLOR transcolor)
{
	myfile = file;
	myTexture = NULL;

	HRESULT result;
	result = D3DXGetImageInfoFromFile(file, &info);

	if(result != D3D_OK)
	{
		F_DebugMessage(__TIMESTAMP__,__FILE__,__FUNCTION__,__LINE__, "Could not find image");
		return 0;
	}



	D3DXCreateTextureFromFileEx(
								myD3DDEV,
								file,
								info.Width,
								info.Height,
								1,
								D3DPOOL_DEFAULT,
								D3DFMT_A8R8G8B8,
								D3DPOOL_DEFAULT,
								D3DX_DEFAULT,
								D3DX_DEFAULT,
								transcolor,
								&info,
								NULL,
								&myTexture);


	return 1;
}



[Edited by - STRATERCAS on September 29, 2005 2:36:33 AM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.