Post

 Resources 

Console


Re: Direct3DSurfaces (DX8) Brian Clark (0 replies, 0 views) (2001-Apr-26)
-
Here is some info straight from the sdk: Private Surface Data You can store any kind of application-specific data with a surface. For example, a surface representing a map in a game might contain information about terrain. A surface can have more than one private data buffer. Each buffer is identified by a GUID that you supply when attaching the data to the surface. To store private surface data, use the Direct3DSurface8.SetPrivateData method, passing a buffer that contains data to associate with the surface, the size of the data buffer, and an application-defined DXGUID for the data. SetPrivateData allocates an internal buffer for the data and copies it. You can then safely free the source buffer or object. The internal buffer or interface reference is released when Direct3DSurface8.FreePrivateData is called. This happens automatically when the surface is freed. To retrieve private data for a surface, you must allocate a buffer of the correct size and then call the Direct3DSurface8.GetPrivateData method, passing the DXGUID that was assigned to the data by SetPrivateData. You are responsible for freeing any dynamic memory you use for this buffer. If you don't know how big a buffer to allocate, first call GetPrivateData with zero in SizeOfData. If the method fails with D3DERR_MOREDATA, it returns the necessary number of bytes for the buffer in SizeOfData.


-
Up One Level | Back to Forum


Copyright © 2002 - 2004 Eric Coleman, Peter Kuchnio , et. al.
There have been 33 visitors within the last 20 minutes
RSS News Feed