Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

167 lines
6.1 KiB

  1. /*==========================================================================
  2. *
  3. * Copyright (C) 1997 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: ddraw3i.h
  6. * Content: DirectDraw 3 internal data structures
  7. * History:
  8. * Date By Reason
  9. * ==== == ======
  10. * 27-feb-97 craige initial implementation
  11. *
  12. ***************************************************************************/
  13. #define DDRAWISURFGBL_MEMFREE 0x00000001L // memory has been freed
  14. #define DDRAWISURFGBL_SYSMEMREQUESTED 0x00000002L // surface is in system memory at request of user
  15. #define DDRAWISURF_HASPIXELFORMAT 0x00002000L // surface structure has pixel format data
  16. typedef ULONG_PTR FLATPTR;
  17. typedef struct _DDRAWI_DDRAWSURFACE_GBL FAR *LPDDRAWI_DDRAWSURFACE_GBL;
  18. typedef struct _DDRAWI_DDRAWSURFACE_MORE FAR *LPDDRAWI_DDRAWSURFACE_MORE;
  19. typedef struct _DDRAWI_DDRAWSURFACE_LCL FAR *LPDDRAWI_DDRAWSURFACE_LCL;
  20. typedef struct _DDRAWI_DDRAWSURFACE_INT FAR *LPDDRAWI_DDRAWSURFACE_INT;
  21. /*
  22. * DBLNODE - a node in a doubly-linked list of surface interfaces
  23. */
  24. typedef struct _DBLNODE
  25. {
  26. struct _DBLNODE FAR *next; // link to next node
  27. struct _DBLNODE FAR *prev; // link to previous node
  28. LPDDRAWI_DDRAWSURFACE_LCL object; // link to object
  29. LPDDRAWI_DDRAWSURFACE_INT object_int; // object interface
  30. } DBLNODE;
  31. typedef DBLNODE FAR *LPDBLNODE;
  32. /*
  33. * DDRAW surface interface struct
  34. */
  35. typedef struct _DDRAWI_DDRAWSURFACE_INT
  36. {
  37. LPVOID lpVtbl; // pointer to array of interface methods
  38. LPDDRAWI_DDRAWSURFACE_LCL lpLcl; // pointer to interface data
  39. LPDDRAWI_DDRAWSURFACE_INT lpLink; // link to next interface
  40. DWORD dwIntRefCnt; // interface reference count
  41. } DDRAWI_DDRAWSURFACE_INT;
  42. /*
  43. * DDRAW internal version of DIRECTDRAWSURFACE struct
  44. *
  45. * the GBL structure is global data for all duplicate objects
  46. */
  47. typedef struct _DDRAWI_DDRAWSURFACE_GBL
  48. {
  49. DWORD dwRefCnt; // reference count
  50. DWORD dwGlobalFlags; // global flags
  51. union
  52. {
  53. LPVOID lpRectList; // list of accesses
  54. DWORD dwBlockSizeY; // block size that display driver requested (return)
  55. };
  56. union
  57. {
  58. LPVOID lpVidMemHeap; // heap vidmem was alloc'ed from
  59. DWORD dwBlockSizeX; // block size that display driver requested (return)
  60. };
  61. union
  62. {
  63. LPVOID lpDD; // internal DIRECTDRAW object
  64. LPVOID lpDDHandle; // handle to internal DIRECTDRAW object
  65. // for use by display driver
  66. // when calling fns in DDRAW16.DLL
  67. };
  68. FLATPTR fpVidMem; // pointer to video memory
  69. union
  70. {
  71. LONG lPitch; // pitch of surface
  72. DWORD dwLinearSize; // linear size of non-rectangular surface
  73. };
  74. WORD wHeight; // height of surface
  75. WORD wWidth; // width of surface
  76. DWORD dwUsageCount; // number of access to this surface
  77. DWORD dwReserved1; // reserved for use by display driver
  78. //
  79. // NOTE: this part of the structure is ONLY allocated if the pixel
  80. // format differs from that of the primary display
  81. //
  82. DDPIXELFORMAT ddpfSurface; // pixel format of surface
  83. } DDRAWI_DDRAWSURFACE_GBL;
  84. /*
  85. * a structure holding additional LCL surface information (can't simply be appended
  86. * to the LCL structure as that structure is of variable size).
  87. */
  88. typedef struct _DDRAWI_DDRAWSURFACE_MORE
  89. {
  90. DWORD dwSize;
  91. VOID FAR *lpIUnknowns; // IUnknowns aggregated by this surface
  92. LPVOID lpDD_lcl; // Pointer to the DirectDraw local object
  93. DWORD dwPageLockCount; // count of pagelocks
  94. DWORD dwBytesAllocated; // size of sys mem allocated
  95. LPVOID lpDD_int; // Pointer to the DirectDraw interface
  96. DWORD dwMipMapCount; // Number of mip-map levels in the chain
  97. LPVOID lpDDIClipper; // Interface to attached clipper object
  98. } DDRAWI_DDRAWSURFACE_MORE;
  99. /*
  100. * the LCL structure is local data for each individual surface object
  101. */
  102. struct _DDRAWI_DDRAWSURFACE_LCL
  103. {
  104. LPDDRAWI_DDRAWSURFACE_MORE lpSurfMore; // pointer to additional local data
  105. LPDDRAWI_DDRAWSURFACE_GBL lpGbl; // pointer to surface shared data
  106. DWORD hDDSurface; // NT Kernel-mode handle was dwUnused0
  107. LPVOID lpAttachList; // link to surfaces we attached to
  108. LPVOID lpAttachListFrom;// link to surfaces that attached to this one
  109. DWORD dwLocalRefCnt; // object refcnt
  110. DWORD dwProcessId; // owning process
  111. DWORD dwFlags; // flags
  112. DDSCAPS ddsCaps; // capabilities of surface
  113. union
  114. {
  115. LPVOID lpDDPalette; // associated palette
  116. LPVOID lp16DDPalette; // 16-bit ptr to associated palette
  117. };
  118. union
  119. {
  120. LPVOID lpDDClipper; // associated clipper
  121. LPVOID lp16DDClipper; // 16-bit ptr to associated clipper
  122. };
  123. DWORD dwModeCreatedIn;
  124. DWORD dwBackBufferCount; // number of back buffers created
  125. DDCOLORKEY ddckCKDestBlt; // color key for destination blt use
  126. DDCOLORKEY ddckCKSrcBlt; // color key for source blt use
  127. // IUnknown FAR *pUnkOuter; // outer IUnknown
  128. DWORD hDC; // owned dc
  129. DWORD dwReserved1; // reserved for use by display driver
  130. /*
  131. * NOTE: this part of the structure is ONLY allocated if the surface
  132. * can be used for overlays. ddckCKSrcOverlay MUST NOT BE MOVED
  133. * from the start of this area.
  134. */
  135. DDCOLORKEY ddckCKSrcOverlay;// color key for source overlay use
  136. DDCOLORKEY ddckCKDestOverlay;// color key for destination overlay use
  137. LPDDRAWI_DDRAWSURFACE_INT lpSurfaceOverlaying; // surface we are overlaying
  138. DBLNODE dbnOverlayNode;
  139. /*
  140. * overlay rectangle, used by DDHEL
  141. */
  142. RECT rcOverlaySrc;
  143. RECT rcOverlayDest;
  144. /*
  145. * the below values are kept here for ddhel. they're set by UpdateOverlay,
  146. * they're used whenever the overlays are redrawn.
  147. */
  148. DWORD dwClrXparent; // the *actual* color key (override, colorkey, or CLR_INVALID)
  149. DWORD dwAlpha; // the per surface alpha
  150. /*
  151. * overlay position
  152. */
  153. LONG lOverlayX; // current x position
  154. LONG lOverlayY; // current y position
  155. };
  156. typedef struct _DDRAWI_DDRAWSURFACE_LCL DDRAWI_DDRAWSURFACE_LCL;