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.

84 lines
2.6 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: d3d.hxx
  3. *
  4. * D3D support.
  5. *
  6. * Created: 12-Jun-1996
  7. * Author: Drew Bliss [drewb]
  8. *
  9. * Copyright (c) 1996-1999 Microsoft Corporation
  10. *
  11. \**************************************************************************/
  12. #ifndef __D3D_HXX__
  13. #define __D3D_HXX__
  14. /*********************************Struct***********************************\
  15. * struct D3DNTHAL_OBJECT
  16. *
  17. * Wrapper for Direct3D driver objects so we can remember what DirectDraw
  18. * surface they were created on. We need to know this information so
  19. * we can do proper locking and lookup of the global DirectDraw object.
  20. *
  21. * These objects are handle-managed for cleanup purposes.
  22. *
  23. \**************************************************************************/
  24. #define DNHO_CONTEXT 0
  25. #define DNHO_TEXTURE 1
  26. #define DNHO_MATRIX 2
  27. #define DNHO_MATERIAL 3
  28. struct D3DNTHAL_OBJECT : public DD_OBJECT
  29. {
  30. // Type of object, one of the DNHO constants.
  31. DWORD dwType;
  32. // Driver handle being wrapped.
  33. ULONG_PTR dwDriver;
  34. // DDraw global information.
  35. EDD_DIRECTDRAW_GLOBAL* peDdGlobal;
  36. // Next object in lookup lists.
  37. D3DNTHAL_OBJECT* pdhobj;
  38. };
  39. /*********************************Struct***********************************\
  40. * struct D3DNTHAL_CONTEXT
  41. *
  42. * Wrapper for Direct3D driver contexts so we can remember what DirectDraw
  43. * surface they were created on.
  44. *
  45. \**************************************************************************/
  46. #define DNHO_HASH_SIZE 64
  47. #define DNHO_HASH_KEY(dwHandle) ((DWORD)((dwHandle) >> 5) & (DNHO_HASH_SIZE-1))
  48. struct D3DNTHAL_CONTEXT : public D3DNTHAL_OBJECT
  49. {
  50. // DirectDrawLocal
  51. EDD_DIRECTDRAW_LOCAL* peDdLocal;
  52. // Surface handles for auto-surface locking.
  53. HANDLE hSurfColor;
  54. HANDLE hSurfZ;
  55. // Context data area pointer for DrawPrimitive data storage.
  56. PVOID pvBufferAlloc;
  57. PVOID pvBufferAligned;
  58. ULONG cjBuffer;
  59. HANDLE hBufSecure;
  60. // Hash table for driverhandle to driverobj handle lookup.
  61. D3DNTHAL_OBJECT* pdhobjHash[DNHO_HASH_SIZE];
  62. // Interface number
  63. ULONG_PTR Interface;
  64. };
  65. DWORD D3dDeleteHandle(HANDLE hD3dHandle, ULONG_PTR dwContext,
  66. BOOL *pbLocked, HRESULT *phr);
  67. // Callback that the drivers can use to parse unknown commands passed
  68. // to them via the DrawPrimitives2 callback
  69. HRESULT CALLBACK D3DParseUnknownCommand (LPVOID lpvCommands,
  70. LPVOID *lplpvReturnedCommand);
  71. #endif // __D3D_HXX__