Archived

This topic is now archived and is closed to further replies.

Strange pointer problem..

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

I have the following: CMesh *Mesh; Mesh = new CMesh(TBox); Render.RenderMesh(Mesh); Mesh->Render(); The Mesh is created correctly and when I write Render.RenderMesh(Mesh) the code goes to the render function. Inside Mesh.Render() is the following code: CD3DRender::Get().RenderMesh(this); The first thing I do in my rendermesh function is this: if( NULL == m_pd3dDevice) { CLog::Get().Write("Error!!"); return; } If I call rendermesh directly via Render.RenderMesh(Mesh) then this check succeeds and my Device is failed. If I call Mesh.Render() the check on my device fails and I get 'Error!' written to my log file. How is this possible? [edited by - Scheermesje on March 27, 2004 10:21:40 AM] [edited by - Scheermesje on March 27, 2004 10:22:06 AM] [edited by - Scheermesje on March 27, 2004 10:22:42 AM]

Share this post


Link to post
Share on other sites
Sorry.. that was just a typo. I wrote -> in my code so that's not the problem

(Has someone tried to edit a file where he uses [ source ] thingies.. they are completely ruined by the editor...?)

[edited by - Scheermesje on March 27, 2004 10:24:23 AM]

Share this post


Link to post
Share on other sites
Thnx for your help

If I changed in my Setup function things like Render.Init to CD3DRender::Get().Init my Mesh.Render() function works(and Render.Rendermesh() does not work)

Is there a way to make sure they work both?

I''m now using the following architecture:

CApp inherits from CRazorFramework, CRazorframework has an instace of CWindow, CD3DRender, CLog.

If I want to write to my logfile I could call CLog::Get().Write("") or I could say CRazorframework::Get().Log.Write("").

Which is a better way to do it? I''m just completely stuck in things like singleton and when to use them I don''t think my design is ''perfect'' because all the modules depend on eachother way to much..

I hope someone gets my problem and could help me out

Share this post


Link to post
Share on other sites