Won't let me draw textures!

3 replies to this topic

#1gardon

Valued Member

• Members
• 282 posts

Posted 02 September 2006 - 06:34 AM

Check this out:

if (GetKeyState(VK_RCONTROL) & 0xFF00){

// Begin Scene Rendering

m_pD3DDevice->BeginScene();

gSprite->Begin(0);

gSprite->Draw(gTexture, NULL, ¢er, &pos, D3DCOLOR_XRGB(255, 255, 255));gSprite->End();

// End Scene Rendering

m_pD3DDevice->EndScene();

}

Everything is initialized and stored fine. However, the problem lies when I resize/Change my window device -- go into fullscreen mode, for example.

If I never hit the Ctrl key, it's fine, the screen will reboot itself and let the application continue, over and over again.

But, once I hit Ctrl for the first time, and the bitmap is displayed (which I can display over and over again since it goes away after releasing the key), after I switch modes it crashes.

What's the deal?

Jason

#2Goz

Senior Member

• Members
• 575 posts

Posted 02 September 2006 - 01:03 PM

You need to reinitialise your resources. Look up a "Lost Device" in the DX help.

#3gardon

Valued Member

• Members
• 282 posts

Posted 02 September 2006 - 11:51 PM

It shouldn't matter, since I reload everything after the device is reset. I made sure of this.

#4Goz

Senior Member

• Members
• 575 posts

Posted 03 September 2006 - 11:18 AM

Have you tried using hte DX debug libraries and upping the debug output level? May be something useful in there ... really sounds, though, as if it is some kind of resource not getting reinitialised ...

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users