📄 ddrawi.h
字号:
} DDRAWI_DDRAWCLIPPER_INT;
/*
* DDRAW internal version of DIRECTDRAWCLIPPER object; it has data after the vtable
*/
typedef struct _DDRAWI_DDRAWCLIPPER_GBL
{
DWORD dwRefCnt; // reference count
DWORD dwFlags; // flags
LPDDRAWI_DIRECTDRAW_GBL lpDD; // PRIVATE: DIRECTDRAW object
DWORD dwProcessId; // owning process
ULONG_PTR dwReserved1; // reserved for use by display driver
ULONG_PTR hWnd; // window
LPRGNDATA lpStaticClipList; // clip list set by app
} DDRAWI_DDRAWCLIPPER_GBL;
/*
* (CMcC) As with palettes, the clipper no longer maintains a back pointer to the
* owning surface (there may now be many owning surfaces). So the lpDDSurface
* is now dwReserved0 (this mod. assumes that sizeof(DWORD) ==
* sizeof(LPDDRAWI_DDRAWSURFACE_LCL). A fairly safe assumption I think.
*/
typedef struct _DDRAWI_DDRAWCLIPPER_LCL
{
DWORD lpClipMore; // pointer to additional local data
LPDDRAWI_DDRAWCLIPPER_GBL lpGbl; // pointer to data
LPDDRAWI_DIRECTDRAW_LCL lpDD_lcl; // pointer to owning local DD object
DWORD dwLocalRefCnt; // local ref cnt
IUnknown FAR *pUnkOuter; // outer IUnknown
LPDDRAWI_DIRECTDRAW_INT lpDD_int; // pointer to owning DD object interface
ULONG_PTR dwReserved1; // reserved for use by display driver
IUnknown * pAddrefedThisOwner; //This is the ddraw object that created this
//clipper, if nonzero. Must Release it when clipper
//is released.
} DDRAWI_DDRAWCLIPPER_LCL;
#define DDRAWICLIP_WATCHWINDOW 0x00000001l
#define DDRAWICLIP_ISINITIALIZED 0x00000002l
#define DDRAWICLIP_INMASTERSPRITELIST 0x00000004l // clipper is referenced in master sprite list
/*
* ATTACHLIST - internally used to maintain list of attached surfaces
*/
typedef struct _ATTACHLIST
{
DWORD dwFlags;
struct _ATTACHLIST FAR *lpLink; // link to next attached surface
struct _DDRAWI_DDRAWSURFACE_LCL FAR *lpAttached; // attached surface local obj
struct _DDRAWI_DDRAWSURFACE_INT FAR *lpIAttached; // attached surface interface
} ATTACHLIST;
typedef ATTACHLIST FAR *LPATTACHLIST;
#define DDAL_IMPLICIT 0x00000001l
/*
* DBLNODE - a node in a doubly-linked list of surface interfaces
*/
typedef struct _DBLNODE
{
struct _DBLNODE FAR *next; // link to next node
struct _DBLNODE FAR *prev; // link to previous node
LPDDRAWI_DDRAWSURFACE_LCL object; // link to object
LPDDRAWI_DDRAWSURFACE_INT object_int; // object interface
} DBLNODE;
typedef DBLNODE FAR *LPDBLNODE;
/*
* ACCESSRECTLIST - internally used to all rectangles that are accessed on a surface
*/
typedef struct _ACCESSRECTLIST
{
struct _ACCESSRECTLIST FAR *lpLink; // link to next attached surface
RECT rDest; // rectangle being used
LPDDRAWI_DIRECTDRAW_LCL lpOwner; // owning local object
LPVOID lpSurfaceData; // associated screen ptr
DWORD dwFlags; // PRIVATE: flags
LPHEAPALIASINFO lpHeapAliasInfo; // PRIVATE: aliased heaps being used by this lock
} ACCESSRECTLIST;
typedef ACCESSRECTLIST FAR *LPACCESSRECTLIST;
#define ACCESSRECT_VRAMSTYLE 0x00000001L // PRIVATE: this lock is vram style (vidmem or implict sysmem)
#define ACCESSRECT_NOTHOLDINGWIN16LOCK 0x00000002L // PRIVATE: this lock is not holding the Win16 lock
#define ACCESSRECT_BROKEN 0x00000004L // PRIVATE: this lock was broken by an invalidate - don't call HAL on unlock
#ifndef WIN95
/*
* Do not change the size of this struct. This will move various members of surface and ddraw
* structs and will prevent binaries from running on old win2k systems (or mismatched later NT builds)
*/
typedef struct _DISPLAYMODEINFO
{
WORD wWidth;
WORD wHeight;
BYTE wBPP;
BYTE wMonitorsAttachedToDesktop;
WORD wRefreshRate;
} DISPLAYMODEINFO;
typedef struct _DISPLAYMODEINFO *LPDISPLAYMODEINFO;
#define EQUAL_DISPLAYMODE(a, b) (0 == memcmp(&(a), &(b), sizeof (DISPLAYMODEINFO)))
#endif
/*
* DDRAW surface interface struct
*/
typedef struct _DDRAWI_DDRAWSURFACE_INT
{
LPVOID lpVtbl; // pointer to array of interface methods
LPDDRAWI_DDRAWSURFACE_LCL lpLcl; // pointer to interface data
LPDDRAWI_DDRAWSURFACE_INT lpLink; // link to next interface
DWORD dwIntRefCnt; // interface reference count
} DDRAWI_DDRAWSURFACE_INT;
/*
* DDRAW internal version of DIRECTDRAWSURFACE struct
*
* the GBL structure is global data for all duplicate objects
*/
typedef struct _DDRAWI_DDRAWSURFACE_GBL
{
DWORD dwRefCnt; // reference count
DWORD dwGlobalFlags; // global flags
union
{
LPACCESSRECTLIST lpRectList; // list of accesses
DWORD dwBlockSizeY; // block size that display driver requested (return)
LONG lSlicePitch; // slice pitch for volume textures
};
union
{
LPVMEMHEAP lpVidMemHeap; // heap vidmem was alloc'ed from
DWORD dwBlockSizeX; // block size that display driver requested (return)
};
union
{
LPDDRAWI_DIRECTDRAW_GBL lpDD; // internal DIRECTDRAW object
LPVOID lpDDHandle; // handle to internal DIRECTDRAW object
// for use by display driver
// when calling fns in DDRAW16.DLL
};
FLATPTR fpVidMem; // pointer to video memory
union
{
LONG lPitch; // pitch of surface
DWORD dwLinearSize; // linear size of non-rectangular surface
};
WORD wHeight; // height of surface
WORD wWidth; // width of surface
DWORD dwUsageCount; // number of access to this surface
ULONG_PTR dwReserved1; // reserved for use by display driver
//
// NOTE: this part of the structure is ONLY allocated if the pixel
// format differs from that of the primary display
//
DDPIXELFORMAT ddpfSurface; // pixel format of surface
} DDRAWI_DDRAWSURFACE_GBL;
/*
* This is an extender structure that is allocated off the end of the SURFACE_GBL
* structure. DO NOT place any structures whose size can change in here.
*/
#define GET_LPDDRAWSURFACE_GBL_MORE(psurf_gbl) \
(*(LPDDRAWI_DDRAWSURFACE_GBL_MORE *) \
((BYTE *)psurf_gbl - sizeof(DWORD_PTR)))
/*
* Return the physical memory pointer for a given surface global object.
*
* NOTE: The physical memory pointer is ONLY valid for surfaces allocated from
* non-local video memory. This field will not be valid for system memory or
* local video memory surfaces.
*/
#define SURFACE_PHYSICALVIDMEM( psurf_gbl ) \
( GET_LPDDRAWSURFACE_GBL_MORE( psurf_gbl )->fpPhysicalVidMem )
/*
* NOTE: This structure contains a set of fields for describing linear to physical
* page mappings in the case of page locked system memory. It can also contain the
* physical surface pointer of a surface in non-local memory. As there is no point
* in having both a linear to physical page translation table and a physical memory
* pointer for the same surface they are placed in a union.
*/
typedef struct _DDRAWI_DDRAWSURFACE_GBL_MORE
{
DWORD dwSize;
union
{
DWORD dwPhysicalPageTable; // Physical address of page table (array of physical addresses/one per 4K page)
FLATPTR fpPhysicalVidMem; // Physical address of surface (non-local video memory only)
};
LPDWORD pPageTable; // Linear address of page table
DWORD cPages; // Number of Pages
ULONG_PTR dwSavedDCContext; // PRIVATE: For use by DDSurface::GetDC
FLATPTR fpAliasedVidMem; // PRIVATE: Alias for original fpVidMem
ULONG_PTR dwDriverReserved; // Reserved for driver use (both system and video memory surfaces)
ULONG_PTR dwHELReserved; // PRIVATE: For HEL use only
DWORD cPageUnlocks; // Incremented whenever a surface is PageUnlocked
ULONG_PTR hKernelSurface; // Kernel handle for this surface
DWORD dwKernelRefCnt; // Ref count for kernel handle
LPDDCOLORCONTROL lpColorInfo; // PRIVATE: Initial color control settings
FLATPTR fpNTAlias; // PRIVATE: Used internally by NT DirectDraw
DWORD dwContentsStamp; // Changes when surface data may have changed. 0 means no information
LPVOID lpvUnswappedDriverReserved; // Reserved for use by display driver. Is not swapped when Flip is called on this surface
LPVOID lpDDRAWReserved2;
DWORD dwDDRAWReserved1;
DWORD dwDDRAWReserved2;
FLATPTR fpAliasOfVidMem; // PRIVATE: The original VidMem pointer of which fpAliasedVidMem is an alias of
// This is used to compare with a given fpVidMem to see if we can use the cached fpAliasedVidMem or
// if we need to call GetAliasedVidMem.
} DDRAWI_DDRAWSURFACE_GBL_MORE;
/*
* a structure holding additional LCL surface information (can't simply be appended
* to the LCL structure as that structure is of variable size).
*/
typedef struct _DDRAWI_DDRAWSURFACE_MORE
{
DWORD dwSize;
IUNKNOWN_LIST FAR *lpIUnknowns; // IUnknowns aggregated by this surface
LPDDRAWI_DIRECTDRAW_LCL lpDD_lcl; // Pointer to the DirectDraw local object
DWORD dwPageLockCount; // count of pagelocks
DWORD dwBytesAllocated; // size of sys mem allocated
LPDDRAWI_DIRECTDRAW_INT lpDD_int; // Pointer to the DirectDraw interface
DWORD dwMipMapCount; // Number of mip-map levels in the chain
LPDDRAWI_DDRAWCLIPPER_INT lpDDIClipper; // Interface to attached clipper object
//------- Fields added in Version 5.0 -------
LPHEAPALIASINFO lpHeapAliasInfo; // PRIVATE: Aliased heaps being referenced by this lock
DWORD dwOverlayFlags; // Current overlay flags
VOID *rgjunc; // Blitter function table for new blitter
LPDDRAWI_DDVIDEOPORT_LCL lpVideoPort; // Video port currently writting data to this surface
LPDDOVERLAYFX lpddOverlayFX; // current overlay fx
DDSCAPSEX ddsCapsEx;
DWORD dwTextureStage; // stage in multitexture cascade
LPVOID lpDDRAWReserved;
LPVOID lpDDRAWReserved2;
LPVOID lpDDrawReserved3;
DWORD dwDDrawReserved4;
LPVOID lpDDrawReserved5;
LPDWORD lpGammaRamp;
LPDWORD lpOriginalGammaRamp;
LPVOID lpDDrawReserved6;
#ifndef WIN95
DISPLAYMODEINFO dmiDDrawReserved7;
#endif
DWORD dwSurfaceHandle; // cookie for use with CreateSurfaceEx DDI
DWORD qwDDrawReserved8[2];
LPVOID lpDDrawReserved9;
DWORD cSurfaces; //PRIVATE
LPDDSURFACEDESC2 pCreatedDDSurfaceDesc2; //PRIVATE
LPDDRAWI_DDRAWSURFACE_LCL *slist; //PRIVATE
DWORD dwFVF; // saved FVF flags for exe bufs
LPVOID lpVB; //PRIVATE
} DDRAWI_DDRAWSURFACE_MORE;
/*
* Special values assigned to dwPFIndex member of DDRAWI_DDRAWSURFACE_MORE.
*/
#define PFINDEX_UNINITIALIZED (0UL) // pixel-format index is in uninitialized state
#define PFINDEX_UNSUPPORTED (~0UL) // surface's pixel format is not supported by HEL
/*
* the LCL structure is local data for each individual surface object
*/
struct _DDRAWI_DDRAWSURFACE_LCL
{
LPDDRAWI_DDRAWSURFACE_MORE lpSurfMore; // pointer to additional local data
LPDDRAWI_DDRAWSURFACE_GBL lpGbl; // pointer to surface shared data
ULONG_PTR hDDSurface; // NT Kernel-mode handle was dwUnused0
LPATTACHLIST lpAttachList; // link to surfaces we attached to
LPATTACHLIST lpAttachListFrom;// link to surfaces that attached to this one
DWORD dwLocalRefCnt; // object refcnt
DWORD dwProcessId; // owning process
DWORD dwFlags; // flags
DDSCAPS ddsCaps; // capabilities of surface
union
{
LPDDRAWI_DDRAWPALETTE_INT lpDDPalette; // associated palette
LPDDRAWI_DDRAWPALETTE_INT lp16DDPalette; // 16-bit ptr to associated palette
};
union
{
LPDDRAWI_DDRAWCLIPPER_LCL lpDDClipper; // associated clipper
LPDDRAWI_DDRAWCLIPPER_INT lp16DDClipper; // 16-bit ptr to associated clipper
};
DWORD dwModeCreatedIn;
DWORD dwBackBufferCount; // number of back buffers created
DDCOLORKEY ddckCKDestBlt; // color key for destination blt use
DDCOLORKEY ddckCKSrcBlt; // color key for source blt use
// IUnknown FAR *pUnkOuter; // outer IUnknown
ULONG_PTR hDC; // owned dc
ULONG_PTR dwReserved1; // reserved for use by display
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -