Sign in to follow this  
rico1986

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

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
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

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