Sign in to follow this  
Pederson

LockRect

Recommended Posts

If i create my texture at 100 by 100 then wouldnt i fill in my pixel data in a for loop from 0 to 10000? but for some reason when my texture is applied to an object(say a simple polygon) it only shows up partly(about 85% is blue and the 15% is black) what could i possible be doing wrong....probably a simple answer but i havent slept in a while...lol...any help would be great! p_device->CreateTexture(100,100,1,D3DUSAGE_DYNAMIC,D3DFMT_A8R8G8B8,D3DPOOL_DEFAULT,&p_texture,NULL); D3DLOCKED_RECT rect; p_texture->LockRect(0,&rect,NULL,D3DLOCK_DISCARD); DWORD* pData=(DWORD*)(rect.pBits); for(long i = 0;i < 10000;i++){ //repeat the same pixel color for the whole texture pData[i] = (DWORD)t.rgba[0]; } p_texture->UnlockRect(0);

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this