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.

90 lines
2.8 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: d3d.c
  3. *
  4. * Client side stubs for the private Direct3D system APIs.
  5. *
  6. * Created: 31-May-1996
  7. * Author: Drew Bliss [drewb]
  8. *
  9. * Copyright (c) 1995-1999 Microsoft Corporation
  10. \**************************************************************************/
  11. #include "precomp.h"
  12. #pragma hdrstop
  13. #undef _NO_COM
  14. #define BUILD_DDDDK
  15. #include <ddrawi.h>
  16. #include "ddstub.h"
  17. #include "d3dstub.h"
  18. // Go from a public DirectDraw surface to a surface handle
  19. #define DDS_HANDLE(lpDDSLcl) \
  20. ((HANDLE)(lpDDSLcl->hDDSurface))
  21. // Go from a public DirectDraw surface to a surface handle, handling the
  22. // NULL case
  23. #define DDS_HANDLE_OR_NULL(pdds) \
  24. ((pdds) != NULL ? DDS_HANDLE(pdds) : NULL)
  25. /******************************Public*Routine******************************\
  26. *
  27. * D3dContextCreate
  28. *
  29. * History:
  30. * Mon Jun 03 14:18:29 1996 -by- Drew Bliss [drewb]
  31. * Created
  32. *
  33. \**************************************************************************/
  34. DWORD WINAPI D3dContextCreate(LPD3DHAL_CONTEXTCREATEDATA pdccd)
  35. {
  36. ASSERTGDI(FIELD_OFFSET(D3DNTHAL_CONTEXTCREATEI, pvBuffer) ==
  37. sizeof(D3DHAL_CONTEXTCREATEDATA),
  38. "D3DNTHAL_CONTEXTCREATEI out of sync\n");
  39. return NtGdiD3dContextCreate(DD_HANDLE(pdccd->lpDDLcl->hDD),
  40. DDS_HANDLE(pdccd->lpDDSLcl),
  41. DDS_HANDLE_OR_NULL(pdccd->lpDDSZLcl),
  42. (D3DNTHAL_CONTEXTCREATEI *)pdccd);
  43. }
  44. /******************************Public*Routine******************************\
  45. *
  46. * D3dDrawPrimitives2
  47. *
  48. * History:
  49. * Mon Jun 17 13:27:05 1996 -by- Anantha Kancherla [anankan]
  50. * Created
  51. *
  52. \**************************************************************************/
  53. DWORD WINAPI D3dDrawPrimitives2(LPD3DHAL_DRAWPRIMITIVES2DATA pdp2data)
  54. {
  55. if (pdp2data->dwFlags & D3DHALDP2_USERMEMVERTICES)
  56. {
  57. return NtGdiD3dDrawPrimitives2 (
  58. (HANDLE)pdp2data->lpDDCommands->hDDSurface,
  59. NULL, // No DDraw surface, pass NULL handle
  60. (LPD3DNTHAL_DRAWPRIMITIVES2DATA)pdp2data,
  61. &pdp2data->lpDDCommands->lpGbl->fpVidMem,
  62. &pdp2data->lpDDCommands->lpGbl->dwLinearSize,
  63. NULL,
  64. NULL
  65. );
  66. }
  67. else
  68. {
  69. return NtGdiD3dDrawPrimitives2 (
  70. (HANDLE)pdp2data->lpDDCommands->hDDSurface,
  71. (HANDLE)pdp2data->lpDDVertex->hDDSurface,
  72. (LPD3DNTHAL_DRAWPRIMITIVES2DATA)pdp2data,
  73. &pdp2data->lpDDCommands->lpGbl->fpVidMem,
  74. &pdp2data->lpDDCommands->lpGbl->dwLinearSize,
  75. &pdp2data->lpDDVertex->lpGbl->fpVidMem,
  76. &pdp2data->lpDDVertex->lpGbl->dwLinearSize
  77. );
  78. }
  79. }