Original Post
Guys, I'm having a strange problem with my background texture in a 3D game. To make matters simple, I have this "sprite", a 800x600 png; It has tree "holes" in it (using alpha blending), so that I can use as an overlay and still have the "background" desired effect. I use a simple loader class to read the sprite (or texture) into the program, then I try to clip it with the following code:
if( SUCCEEDED( pd3dDevice->BeginScene() ) )
{
g_pBGSprite->Begin( D3DXSPRITE_ALPHABLEND );
g_pBGSprite->Draw( g_pBGTexture, NULL, NULL, NULL, D3DCOLOR_ARGB(255, 255, 255, 255) );
g_pBGSprite->End();
V( pd3dDevice->EndScene() );
}
As you can see, the code is very simple. I display it as a solid figure (255,255,255,255), and the actual coloring and transparency - alpha blending (creating the hole effect) works fine. The only problem is that I'm unable to display the whole sprite. My window is 800x600, as is the sprite. But the sprite is clipped to about 75% of its actual size. If I resize the window a few times, it reaches the desired size... But I can't say exactly why. So, is there a way to correct this? Why isn't it displaying correctly? I have to specify the rect for it to display right? Help! :)