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.

53 lines
1.7 KiB

  1. /*============================ ==============================================;
  2. *
  3. * Copyright (C) 1997 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: clipper.h
  6. * Content: Clipper definitions
  7. *
  8. ***************************************************************************/
  9. #ifndef _CLIPPER_H_
  10. #define _CLIPPER_H_
  11. //---------------------------------------------------------------------
  12. // Bit numbers for each clip flag
  13. //
  14. #define D3DCS_LEFTBIT 1
  15. #define D3DCS_RIGHTBIT 2
  16. #define D3DCS_TOPBIT 3
  17. #define D3DCS_BOTTOMBIT 4
  18. #define D3DCS_FRONTBIT 5
  19. #define D3DCS_BACKBIT 6
  20. #define D3DCLIPGB_LEFTBIT 13
  21. #define D3DCLIPGB_RIGHTBIT 14
  22. #define D3DCLIPGB_TOPBIT 15
  23. #define D3DCLIPGB_BOTTOMBIT 16
  24. //---------------------------------------------------------------------
  25. // Make clip vertex from D3D vertex
  26. //
  27. // device - CD3DHal *
  28. // pp1 - clipVertex
  29. // p1 - TL vertex
  30. //
  31. void MAKE_CLIP_VERTEX_FVF(D3DFE_PROCESSVERTICES *pv, ClipVertex& pp1, BYTE* p1,
  32. DWORD clipFlag, BOOL transformed);
  33. //---------------------------------------------------------------------
  34. // Make TL vertex from clip vertex
  35. //
  36. // device - CD3DHal *
  37. // in - clipVertex
  38. // out - TL vertex
  39. //
  40. inline void
  41. MAKE_TL_VERTEX_FVF(D3DFE_PROCESSVERTICES *pv, BYTE* out, ClipVertex* in)
  42. {
  43. *(D3DVECTORH*)out = *(D3DVECTORH*)&(in)->sx;
  44. if (pv->dwVIDOut & D3DFVF_DIFFUSE)
  45. *(DWORD*)&out[pv->diffuseOffsetOut] = (in)->color;
  46. if (pv->dwVIDOut & D3DFVF_SPECULAR)
  47. *(DWORD*)&out[pv->specularOffsetOut] = (in)->specular;
  48. memcpy(&out[pv->texOffsetOut], in->tex, pv->dwTextureCoordSizeTotal);
  49. }
  50. #endif // _CLIPPER_H_