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.

70 lines
1.9 KiB

  1. //----------------------------------------------------------------------------
  2. //
  3. // refif.hpp
  4. //
  5. // Refrast front-end/rasterizer interface header.
  6. //
  7. // Copyright (C) Microsoft Corporation, 1997.
  8. //
  9. //----------------------------------------------------------------------------
  10. #ifndef _REFIF_HPP_
  11. #define _REFIF_HPP_
  12. // Vertex data is aligned on 32-byte boundaries.
  13. #define DP_VTX_ALIGN 32
  14. // Macros to check if a pointer is valid
  15. #if DBG
  16. // Validate context. pCtx should be declared before this macro
  17. // Type can be D3DContext or RefRast
  18. #define VALIDATE_CONTEXT(caller_name, data_ptr, pCtx, type) \
  19. { \
  20. if ((data_ptr) == NULL) \
  21. { \
  22. DPFM(0, DRV, ("in %s, data pointer = NULL", (caller_name))); \
  23. return DDHAL_DRIVER_HANDLED; \
  24. } \
  25. pCtx = (type)((data_ptr)->dwhContext); \
  26. if (!pCtx) \
  27. { \
  28. DPFM(0, DRV, ("in %s, dwhContext = NULL", (caller_name))); \
  29. (data_ptr)->ddrval = D3DHAL_CONTEXT_BAD; \
  30. return DDHAL_DRIVER_HANDLED; \
  31. } \
  32. }
  33. #else // !DBG
  34. // Validate context. pCtx should be declared before this macro
  35. // Type can be D3DContext or RefRast
  36. #define VALIDATE_CONTEXT(caller_name, data_ptr, pCtx, type) \
  37. { \
  38. pCtx = (type)((data_ptr)->dwhContext); \
  39. }
  40. #endif // !DBG
  41. // Validate RefDev. pRefRast should be declared before this macro
  42. #define VALIDATE_REFRAST_CONTEXT(caller_name, data_ptr) \
  43. { \
  44. VALIDATE_CONTEXT(caller_name, data_ptr, pRefDev, RefDev*);\
  45. }
  46. #define CHECK_FVF(ret, pDCtx, dwFlags) \
  47. { \
  48. if ((ret = pDCtx->CheckFVF(dwFlags)) != DD_OK) \
  49. { \
  50. return DDHAL_DRIVER_HANDLED; \
  51. } \
  52. }
  53. DWORD __stdcall
  54. RefRastDrawPrimitives2(LPD3DHAL_DRAWPRIMITIVES2DATA pDPrim2Data);
  55. HRESULT
  56. RefRastLockTarget(RefDev *pRefRast);
  57. void
  58. RefRastUnlockTarget(RefDev *pRefRast);
  59. HRESULT
  60. RefRastUpdatePalettes(RefDev *pRefRast);
  61. #endif // #ifndef _REFIF_HPP_