Jump to content
  • Advertisement
Sign in to follow this  
cinnamon_toast

D3D MFC Woes

This topic is 5080 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

-- Problem fixed, it was creating it in the OnNewDocument function that was the problem, anywhere else and it's fine, though I'm not entirely sure why -- To start off with, please don't tell me not to use MFC, I've heard it all, trust me. :) That said, my program is in an sdi document/view format, and this is the problem: My Direct3D device is encapsulated by a member object of the view object. A vertex buffer is created in a member object of the document object (but it is created from the above mentioned D3D object). When attempting to render said vertex buffer, nothing shows up on the screen, despite all the D3D function calls returning a big thumbs up. But if I create the vertex buffer from within the view object, it shows up fine. I suspect the problem is something about MFC I don't know, but I'm not sure, anyone have any ideas? [Edited by - cinnamon_toast on August 19, 2004 5:14:39 AM]

Share this post


Link to post
Share on other sites
Advertisement
Any chance of seeing the code ? You are right to put the vertex buffer in the document, after all, you want to seperate data from the view.

Share this post


Link to post
Share on other sites
steg:
The source, unfortunately, isn't too intelligible if you don't know my D3D wrapper (and since you're not me, you don't :)), and I don't want to make anybody have to sift through multiple files to figure out what's going on. :)

Share this post


Link to post
Share on other sites
Here's some pseudo code, though, come to think of it this might help

// Document file
OnNewDocument
{
// Retrieve D3D information from view and use it to create vertex buffers, textures, etc from model
}

// View file
OnDraw
{
// Start rendering
// Retrieve model data from document, process the vertices, then render them
// End Rendering
}

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!