Results 1 to 1 of 1

Thread: Locking DirectDraw Surfaces *[Resolved]*

  1. #1

    Thread Starter
    Ex-Super Mod'rater Electroman's Avatar
    Join Date
    Sep 2000
    Location
    Newcastle, England
    Posts
    4,349

    Resolved Locking DirectDraw Surfaces *[Resolved]*

    If I Lock a section of a surafce, area O1 (which is a RECT), then call GetLockedArray B1() should I just get a byte array for the locked area or does it give me the whole surface?
    VB Code:
    1. Sur1.Lock O1, Sur1Desc, DDLOCK_WAIT, 0
    2. Sur1.GetLockedArray B1()
    3.  
    4. For i = 0 To UBound(B1, 1) - 1 Step 3
    5.     For j = 0 To UBound(B1, 2)
    6.        
    7.        
    8.     Next
    9. Next
    10.  
    11. Sur1.Unlock O1
    When I do this it seems to give an area bigger than O1. I'm not sure wheather I should be using Step 4 instead of 3 because its running in 32bit but "(UBound(B1, 1) - 1)/3" is 42 and "(UBound(B1, 1) - 1)/4" is 31.5 for a 32*32 surface, and if theres a remander theres bytes getting missed.Mind "UBound(B1, 2)" is 31 so step 4 would make sense, apart from the remander, because that means 32 elements each way.

    Could someone please point me in the right direct. Thanx.
    Last edited by Electroman; Sep 20th, 2004 at 09:12 AM.
    When your thread has been resolved please edit the original post in the thread ()
    and amend "-[RESOLVED]-" to the end of the title and change the icon to , Thank you.

    When posting Code use the [VBCode]Code Here[/VBCode] tags to be able to use the code highlighting.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width