PDD_CANCREATESURFACE callback function (ddrawint.h)
The CanCreateD3DBuffer callback function determines whether the driver can create a driver-level command or vertex buffer of the specified description.
Syntax
PDD_CANCREATESURFACE PddCancreatesurface;
DWORD PddCancreatesurface(
PDD_CANCREATESURFACEDATA unnamedParam1
)
{...}
Parameters
unnamedParam1
Points to a DD_CANCREATESURFACEDATA structure. This structure contains the information required for the driver to determine whether a command or vertex buffer can be created.
Return value
CanCreateD3DBuffer returns a callback code.
Remarks
This callback is used only if the driver manages driver-level command and vertex buffers.
CanCreateD3DBuffer should check the surface description that the lpDDSurfaceDesc member of the DD_CANCREATESURFACEDATA structure at lpCanCreateD3DBuffer points to in order to determine whether the driver can support the format and capabilities of the requested buffer for the mode that the driver is currently in. The driver should return DD_OK in the ddRVal member of the same structure if it supports that type of buffer. Otherwise, it should return the DDERR_Xxx error code that best describes why it does not support the buffer.
This call has the same prototype as DdCanCreateSurface. The CanCreateD3DBuffer callback is used, however, when the surface in question has the DDSCAPS_EXECUTEBUFFER flag set in the ddsCaps member of the DD_SURFACE_LOCAL structure.
The driver determines the type of buffer being requested by checking the ddsCaps member of the DD_SURFACE_LOCAL structure for the following flags:
Flag | Meaning |
---|---|
DDSCAPS2_COMMANDBUFFER | The driver should allocate a command buffer. |
DDSCAPS2_VERTEXBUFFER | The driver should allocate an explicit vertex buffer. |
Requirements
Requirement | Value |
---|---|
Target Platform | Desktop |
Header | ddrawint.h (include Winddi.h) |