Leaked source code of windows server 2003
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.

120 lines
4.4 KiB

  1. /******************************Module*Header**********************************\
  2. *
  3. * *******************
  4. * * D3D SAMPLE CODE *
  5. * *******************
  6. *
  7. * Module Name: d3dsurf.h
  8. *
  9. * Content: Surface management macros and structures
  10. *
  11. * Copyright (c) 1994-1999 3Dlabs Inc. Ltd. All rights reserved.
  12. * Copyright (c) 1995-2003 Microsoft Corporation. All rights reserved.
  13. \*****************************************************************************/
  14. #ifndef __D3DSURF_H
  15. #define __D3DSURF_H
  16. #define SURF_MAGIC_NO 0xd3d10100
  17. #define CHECK_SURF_INTERNAL_AND_DDSURFACE_VALIDITY(ptr) \
  18. (((ptr) != NULL) && ((ptr)->MagicNo == SURF_MAGIC_NO))
  19. typedef enum tagSurfaceLocation
  20. {
  21. VideoMemory = 0,
  22. SystemMemory,
  23. AGPMemory
  24. } SurfaceLocation;
  25. //********************************************************
  26. // INFORMATION STORED FOR EACH D3D/DD SURFACE MIPMAP LEVEL
  27. //********************************************************
  28. typedef struct tagMIPTEXTURE {
  29. int wWidth;
  30. int wHeight;
  31. int logWidth;
  32. int logHeight; // Widths and heights for this mip level
  33. DWORD dwOffsetFromMemoryBase; // Offset(bytes) to the start of the texture
  34. FLATPTR fpVidMem;
  35. DWORD lPitch;
  36. struct TextureMapWidth P3RXTextureMapWidth; // Texture layout info
  37. // for this mip level
  38. #if DX7_TEXMANAGEMENT
  39. FLATPTR fpVidMemTM; // Address of TM vidmem surface
  40. #endif // DX7_TEXMANAGEMENT
  41. } MIPTEXTURE;
  42. //*******************************************
  43. // INFORMATION STORED FOR EACH D3D/DD SURFACE
  44. //*******************************************
  45. typedef struct _p3_SURF_INTERNAL {
  46. ULONG MagicNo ; // Magic number to verify validity of pointer
  47. P3_SURF_FORMAT* pFormatSurface; // A pointer to the surface format
  48. SurfaceLocation Location;// Is Texture in Vidmem?
  49. DWORD dwLUTOffset; // The offset to the LUT in the Local Buffer
  50. // for this texture (if it's palletized).
  51. DWORD dwGARTDevLast; // The last GART Dev base address that this
  52. // texture was used from
  53. DWORD wWidth; // Width and Height of surface
  54. DWORD wHeight; // (stored as DWORDS for IA64 compatibility)
  55. int logWidth; // Logs of the width and height
  56. int logHeight;
  57. float fArea; // Area in floating point of the surface
  58. DDSCAPS ddsCapsInt; // Store PDD_SURFACE_LOCAL data that we
  59. DWORD dwFlagsInt; // we'll need later for hw setup
  60. DWORD dwCKLow, dwCKHigh; // With the exception of D3DCreateSurfaceEx
  61. DDPIXELFORMAT pixFmt; // we can't/shouldn't at any other time
  62. DWORD dwPixelSize; // look inside these structures as they
  63. DWORD dwPixelPitch; // are DX RT property and may be destroyed
  64. DWORD dwPatchMode; // at any time without notifying the
  65. DWORD lPitch; // driver
  66. DWORD dwBitDepth; //
  67. ULONG lOffsetFromMemoryBase;
  68. FLATPTR fpVidMem; // Pointer to the surface memory
  69. BOOL bMipMap; // Do we have mipmaps in this texture?
  70. int iMipLevels; // The # of mipmap levels stored
  71. MIPTEXTURE MipLevels[P3_LOD_LEVELS]; // Mipmaps setting info
  72. #if DX8_3DTEXTURES
  73. BOOL b3DTexture; // Is this a 3D texture ?
  74. WORD wDepth; // depth of the 3D texture
  75. int logDepth; // log of the depth
  76. DWORD dwSlice; // size of each 2D slice
  77. DWORD dwSliceInTexel; // size of each 2D slice in Texel
  78. #endif // DX8_3DTEXTURES
  79. #if DX8_MULTISAMPLING
  80. DWORD dwSampling; // Number of pixels for sampling.
  81. #endif // DX8_MULTISAMPLING
  82. #if DX7_TEXMANAGEMENT
  83. DWORD dwCaps2;
  84. DWORD m_dwBytes;
  85. DWORD m_dwPriority;
  86. DWORD m_dwTicks;
  87. DWORD m_dwHeapIndex;
  88. BOOL m_bTMNeedUpdate;
  89. DWORD m_dwTexLOD; // Level of detail we're required to load
  90. #endif // DX7_TEXMANAGEMENT
  91. #if DX7_PALETTETEXTURE // Saved when D3DDP2OP_SETPALETTE is received
  92. DWORD dwPaletteHandle; // Palette handle associated to this texture
  93. DWORD dwPaletteFlags; // Palette flags regarding the assoc palette
  94. #endif
  95. } P3_SURF_INTERNAL;
  96. #endif // __D3DSURF_H