Sign in to follow this  

D3D MFC Woes

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

This topic is 4868 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.

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