Jump to content
  • Advertisement
Sign in to follow this  
Ravnock

MFC + DirectX Render Problem

This topic is 3684 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi everybody, I'm programming a development tool that uses the Microsoft Foundation Classes (MFC) and DirectX 9.0. It has a render view. At first I used a LPD3DXMESH teapot to test I could paint a 3d scene right. Later I changed to my own proprietary format and then the view doesn't update itself properly.( At the begining of the app shows my mesh, but when I minimize and maximize keeps the others window aspect) I changed the Directx to debug mode and a break is thrown in this code of the cmdtarg.cpp file: case AfxSigCmd_v: // normal command or control notification ASSERT(CN_COMMAND == 0); // CN_COMMAND same as BN_CLICKED ASSERT(pExtra == NULL); (pTarget->*mmf.pfnCmd_v_v)(); break; I tested my mesh format in other project and works right. I don't know what to do. Someone can help me? (sorry if my english is a bit bad)

Share this post


Link to post
Share on other sites
Advertisement
What do the Debug runtimes say? What do you mean by "when I minimize and maximize keeps the others window aspect"? What other window? What sort of debug break do you get there? What line? What's the error you get in the debug spew?

Share this post


Link to post
Share on other sites
Uhm, the debug runtime shows the following error

Direct3D9: (ERROR) :Texture not created with this device. SetTexture failed.

The break message showed by VC is the following

MFC.exe has triggered a breakpoint

And I try to explain that when I minimize and maximize my app and I have other windows opened the render view of my app gets the image of the others window (doesn't update itself)

Share this post


Link to post
Share on other sites
Quote:
Original post by Ravnock
Uhm, the debug runtime shows the following error

Direct3D9: (ERROR) :Texture not created with this device. SetTexture failed.
Are you using multiple devices? That's usually A Bad Thing, might show up driver bugs (Multiple devices isn't a common scenario and probably isn't tested as well as other methods), and is slower than using a single device. If not, it sounds like you have some weird memory corruption going on.

Quote:
Original post by Ravnock
The break message showed by VC is the following

MFC.exe has triggered a breakpoint
On what line? Is there anything else in the debug output above that? E.g. any errors or exceptions?

Quote:
Original post by Ravnock
And I try to explain that when I minimize and maximize my app and I have other windows opened the render view of my app gets the image of the others window (doesn't update itself)
That sounds to me like Present() is failing, or you're not updating somehow. Nothing will be getting drawn to the window, so it won't be redrawn and will show whatever was over the window before it.

Share this post


Link to post
Share on other sites
I think the update is doing right, because if I change from my mesh to LPD3DXMESH, LPD3DXMESH updates right.

I will check if there are bad pointers. And I will look for the texture error reason.

Thank you for all

Share this post


Link to post
Share on other sites
Quote:
Original post by Ravnock
I think the update is doing right, because if I change from my mesh to LPD3DXMESH, LPD3DXMESH updates right.

I will check if there are bad pointers. And I will look for the texture error reason.

Thank you for all
I'd suggest cutting out parts of your mesh code until it magically starts working again, then you'll know what's causing the problem. If it works with the D3DX mesh, then it's almost definitely a problem with your custom mesh code.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!