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.

77 lines
3.4 KiB

  1. /*==========================================================================;
  2. *
  3. * Copyright (C) 1997 Microsoft Corporation. All Rights Reserved.
  4. *
  5. * File: clipfunc.h
  6. * Content: Clipper functions
  7. *
  8. ***************************************************************************/
  9. #ifndef _CLIPFUNC_H_
  10. #define _CLIPFUNC_H_
  11. #include "clipper.h"
  12. int ClipSingleLine(D3DFE_PROCESSVERTICES *pv,
  13. ClipTriangle *line,
  14. D3DRECTV *extent);
  15. HRESULT ProcessClippedPoints(D3DFE_PROCESSVERTICES*);
  16. HRESULT ProcessClippedTriangleList (D3DFE_PROCESSVERTICES*);
  17. HRESULT ProcessClippedTriangleStrip(D3DFE_PROCESSVERTICES *pv);
  18. HRESULT ProcessClippedTriangleFan (D3DFE_PROCESSVERTICES *pv);
  19. HRESULT ProcessClippedLine(D3DFE_PROCESSVERTICES *pv);
  20. HRESULT ProcessClippedIndexedTriangleStrip(D3DFE_PROCESSVERTICES *pv);
  21. HRESULT ProcessClippedIndexedTriangleFan (D3DFE_PROCESSVERTICES *pv);
  22. HRESULT ProcessClippedIndexedTriangleList (D3DFE_PROCESSVERTICES *pv);
  23. HRESULT ProcessClippedIndexedLine(D3DFE_PROCESSVERTICES *pv);
  24. DWORD D3DFE_GenClipFlags(D3DFE_PROCESSVERTICES *pv);
  25. //---------------------------------------------------------------------
  26. // This function is called by the clipper to draw unclipped part of a primitive
  27. //
  28. inline HRESULT DRAW_PRIM(D3DFE_PROCESSVERTICES *pv,
  29. D3DPRIMITIVETYPE primitiveType,
  30. LPVOID startVertex, DWORD vertexCount, DWORD numPrim)
  31. {
  32. pv->lpvOut = startVertex;
  33. pv->primType = primitiveType;
  34. pv->dwNumVertices = vertexCount;
  35. pv->dwNumPrimitives = numPrim;
  36. return pv->DrawPrim();
  37. }
  38. //---------------------------------------------------------------------
  39. // This function is called by the clipper to draw clipped part of a primitive
  40. //
  41. inline HRESULT DRAW_CLIPPED_PRIM(D3DFE_PROCESSVERTICES *pv,
  42. D3DPRIMITIVETYPE primitiveType,
  43. LPVOID startVertex, DWORD vertexCount, DWORD numPrim)
  44. {
  45. pv->lpvOut = startVertex;
  46. pv->primType = primitiveType;
  47. pv->dwNumVertices = vertexCount;
  48. pv->dwNumPrimitives = numPrim;
  49. return pv->DrawClippedPrim();
  50. }
  51. //---------------------------------------------------------------------
  52. // This function is called by the clipper to draw unclipped part of an
  53. // indexed primitive
  54. //
  55. inline HRESULT DRAW_INDEX_PRIM(D3DFE_PROCESSVERTICES *pv,
  56. D3DPRIMITIVETYPE primitiveType,
  57. LPWORD startIndex, DWORD vertexCount, DWORD numPrim)
  58. {
  59. pv->lpwIndices = startIndex;
  60. pv->primType = primitiveType;
  61. pv->dwNumIndices = vertexCount;
  62. pv->dwNumPrimitives = numPrim;
  63. return pv->DrawIndexPrim();
  64. }
  65. //----------------------------------------------------------------------
  66. // Clip a triangle made by 3 vertices
  67. // bCanModifyVertices is set to TRUE, if the function can modify the original
  68. // vertices
  69. //
  70. HRESULT Clip(D3DFE_PROCESSVERTICES *pv, ClipVertex *cv1, ClipVertex *cv2, ClipVertex *cv3);
  71. HRESULT ClipLine(D3DFE_PROCESSVERTICES *pv, ClipVertex *cv1, ClipVertex *cv2);
  72. #endif // _CLIPFUNC_H_