Skip to main content
GameDev.net gamedev.net
🔒 Locked

Locking buffers

Started by ofer Jun 18, 2002 at 9:22 AM 3 replies 550+ views
Original Post
ofer
ofer
hi there, im still strugling drawing my first directx box. its much easier with openGl. anyway, i wanted to know - if i lock a vertex buffer, and than copy some verts to the pointer i recived from the locking, than i unlock the buffer. after sometime i lock it again, and recive the pointer again, will it point to the vertices i copied earlier? because if so that mighth be my problem, becuase when i relock my buffer the second time, the pointer i get from it points to rubbish. thnx.
IndirectX
IndirectX
The pointer will most likely point to the different area. Depending on the flags (DISCARD, in particular) you might have a pointer to garbage or a pointer to memory filled with whatever data you put there last time.

If you aren''t already, use the debug runtime.
---visit #directxdev on afternet <- not just for directx, despite the name
ofer
ofer
ok, thnx for the quick response. i found the problem, and im contiuing my strugling. but one more little thing - is locking a buffer a slow process? i mean, is it better to save another copy of the buffer on system memory for software related access?
IndirectX
IndirectX
quote:
Original post by ofer
is locking a buffer a slow process?


Yes, you should avoid locking if it''s not really necessary.
quote:

is it better to save another copy of the buffer on system memory for software related access?

Maybe, depending on your application.
---visit #directxdev on afternet <- not just for directx, despite the name
ofer
ofer
i got you. at last it is like openGl . thanx.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.