The DD_SURFACE_GLOBAL structure contains global surface-related data that can be shared between multiple surfaces.
typedef struct _DD_SURFACE_GLOBAL {
DWORD dwBlockSizeY;
union {
LPVIDEOMEMORY lpVidMemHeap;
DWORD dwBlockSizeX;
DWORD dwUserMemSize;
};
FLATPTR fpVidMem;
union {
LONG lPitch;
DWORD dwLinearSize;
};
LONG yHint;
LONG xHint;
DWORD wHeight;
DWORD wWidth;
ULONG_PTR dwReserved1;
DDPIXELFORMAT ddpfSurface;
FLATPTR fpHeapOffset;
HANDLE hCreatorProcess;
} DD_SURFACE_GLOBAL;
| Value | Meaning |
|---|---|
| DDHAL_PLEASEALLOC_BLOCKSIZE | DirectDraw should allocate a memory block of size dwBlockSizeX and dwBlockSizeY in offscreen memory. |
| DDHAL_PLEASEALLOC_USERMEM | DirectDraw should allocate a memory block of size dwUserMemSize in user-mode memory. |
Defined in ddrawint.h. Include winddi.h.
A vertex buffer, which is created by CreateD3DBuffer, holds a list of vertices used by the D3dDrawPrimitives2 callback for rendering primitives. Windows represents vertex buffers as DirectDraw surfaces, thereby establishing a connection between vertex buffers and the DD_SURFACE_GLOBAL structure.
When a DirectX driver is working with a vertex buffer, it is important for it to be able to correctly determine the size of this buffer. DirectDraw passes the linear buffer size to the driver in the lPitch member of this structure. On Windows 2000 and later versions, but not on Windows 98/Me, the wWidth member of this structure is set to the same value. Note that both structure members should be considered to be read-only. The value that DirectDraw places in these members represents the minimum vertex buffer size. Should the need for a larger buffer arise (such as for optimization), a driver writer is free to create a buffer larger than that size. Under no circumstances, however, should the driver report the larger buffer size to DirectDraw.
CreateD3DBuffer, D3dDrawPrimitives2, DdCreateSurface, DDPIXELFORMAT, VIDEOMEMORY