Jump to content
  • Advertisement
Sign in to follow this  
TheMaskedFace

retail vs debug version - error appeared

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

When I am running my project in debug version of directX(I have 9.0) I got an exception below that code
 vertexBuffers[attrange] = new VertexBuffer(typeof(CustomVertex.PositionNormalTextured), verCount, modelMesh.Device, Usage.WriteOnly, CustomVertex.PositionNormalTextured.Format, Pool.Default);
                vertexBuffers[attrange].SetData(modelVertices, 0, LockFlags.None);
                vertexBuffers[attrange].Unlock();//HERE

the exception is InvalidCallException... But when I run my procejt in retail version I don't get error.I did not understand it.Does anyone can help me?

Share this post


Link to post
Share on other sites
Advertisement
What does the Debug Spew say? Whenever D3D returns an error, it will always output a text string to the debug spew explaining what the problem is. If you're not sure what the Debug Spew is, check out the Forum FAQ.

neneboricua

Share this post


Link to post
Share on other sites
The retail version doesn't test for nearly as many things as the debug runtime. The Forum FAQ will help you debug it. I'd bet there's a message in the debug spew about unlocking things that were never locked.

Share this post


Link to post
Share on other sites
I had examined all debug messages. The error string in the debug screen when you run the project is "D3DERR_INVALIDCALL". It says error in Application.
When I comment out the vertexBuffers[attrange].Unlock(); the project is ok.But then it uses %96-97 of CPU.
I can not find a way

Share this post


Link to post
Share on other sites
Quote:
Original post by TheMaskedFace
I had examined all debug messages. The error string in the debug screen when you run the project is "D3DERR_INVALIDCALL". It says error in Application.
When I comment out the vertexBuffers[attrange].Unlock(); the project is ok.But then it uses %96-97 of CPU.
I can not find a way


It is completely normal that the program uses 95-100 % of your CPU, since you never pause the program, I just played CS:S and it uses 98 % so don't worry that is normal for games.

I'm not familar with DX, but you should probably lock the vertex buffer before calling SetData, but maybe it locks internally, in that case you shouldn't unlock it.

EDIT: Just checked MSDN, the SetData function unlocks (and locks) the vertex buffer, so you should just remove the Unlock call.

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!