Jump to content
  • Advertisement

Archived

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

l99057j

Question about Locking Vertex Buffers

This topic is 5803 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'm having a terrible time cloning a mesh and locking the vertex buffer so that I can add texture coordinates. All I'm doing at the moment is using the application wizard to generate a generic teapot application. After the teapot is created I'm trying to clone the mesh into an FVF that supports textures, this is working fine. But no matter which of the overloaded methods I use to try and lock the vertex buffer I either get an error. I've searched through the online docs as well as all of the sample programs with no luck. I have noticed that none of the sample programs lock the vb of a cloned mesh. Are cloned mesh's represented differently somehow? I'm at my wits end with this and would greatly appreciate any suggestions. If you would like to recreate, just create a generic teapot application and then replace the InitDeviceObjects with the following code you'll have exactly what I have at the moment. ---- begin code snippet ---- protected override void InitializeDeviceObjects() { drawingFont.InitializeDeviceObjects(device); Mesh temp = Mesh.Teapot(device); try { teapot = temp.Clone(MeshFlags.SystemMemory , CustomVertex.PositionNormalTextured.Format, device); } catch(Exception e1) { MessageBox.Show(e1.ToString()); } //Any attempt to lock and unlock the vertex //buffer here fails, regardless of which overload //is used. I have used different MeshFlags during //the above call to Clone() with no changes. } [edited by - l99057j on December 25, 2002 11:56:24 PM]

Share this post


Link to post
Share on other sites
Advertisement

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