Jump to content
  • Advertisement
Sign in to follow this  
rico1986

Create new LPD3DXMESH, add it to template class and then render it problems

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

Hy, I have a small problem with render LPD3DXMESH. When I press a key, then - I create new LPD3DXMESH with (i.e. with D3DXCreateBox (Some Direct3D shape drawing function) ), with random size,rotation,position - Then I add it to the custom created template class. - And then when i render new frame, i cycle trough all meshes in that template class, and render them. I got stuck when calling "pMesh->DrawSubset( 0 )" (thats in Mesh(source) file at line 29. Code for Mesh class is at - (header): http://barvanjekode.gama.us/temp/825275491.html - (source): http://barvanjekode.gama.us/temp/201806804.html Code for main application class is at - (header): http://barvanjekode.gama.us/temp/129804267.html - (source): http://barvanjekode.gama.us/temp/866281346.html in utility, is just function to find a file, includes contains all include files (stdlib.h, d3dx9.h,...), in framework is base definition of app. base is an interface and worldtransform is for positioning,rotation and sizing of meshes/world/sprites... hope, someone can tell me what am i doing wrong here :}

Share this post


Link to post
Share on other sites
Advertisement
yes ... code compiles without a problem, and when i run the app (in debug mode in VS2008) i get message like (unhandled expection at 0.00e68... in ZFTest.exe: 0.C000...: Access violation reading location 0xfeeef3f6.) and the line where i get error is "pMesh->DrawSubset( 0 );"

.....
"First-chance exception at 0x00cd900c in ZFTest.exe: 0xC0000005: Access violation reading location 0xfeeefefa.
Unhandled exception at 0x00cd900c in ZFTest.exe: 0xC0000005: Access violation reading location 0xfeeefefa."

the source (writen in VS2008) of app. can be found at http://gama.us/ZFTest.rar

Share this post


Link to post
Share on other sites
i found the problem :}

in MYApplication.cpp i have this piece of code:

CMYMesh meshT;
meshT.Set...

now i fix it to

CMYMesh* meshT = new CMYMesh();
meshT->Set...

i really laugh when i found this mistake :}

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!