Jump to content
  • Advertisement
Sign in to follow this  
sanity

DD Surface locking: a few questions

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

Sup, I am using the Surface.Lock and Unlock methods for particle/line drawing using managed DirectX and C#, and I was wondering if you guys could answer a few questions or point me in the direction of some rescources. So here goes: 1. Anyone know what the Rectangle in one of the overloaded Lock and Unlock methods of the surface class is used for? I first thought it might represent the screen position that the byte array represented, but it just seems to make my app crash. 2. I have read (and noticed) that locking can be slow when used on large surfaces. Does anyone have any suggestions on how to speed things up? 3. Finally is locking the way you guys draw particles and lines or is their something I have missed? Cheers, Toby.

Share this post


Link to post
Share on other sites
Advertisement
The rectangle is used to lock only a portion of the surface. Supposedly you can lock multiple rectangles (that do not intersect) on a surface and update (use/copy etc.) them at the same time perhaps from differnet threads. I imagine (though I could be completely wrong) that it is faster to lock only the region of the surface that you are interested in.

There are many differnet ways of drawing lines:
The Line class uses textured triangles to provide width and patterns. Line strips and lists can work for simple applications. And have this nice property of actaully being 3d. Like you implied drawing on a surface is another way to get lines. Guess it all really depends on your application.

Sorry, don't know much about particles.

hope this helps.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!