Team Fortress 2 Source Code as on 22/4/2020
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.

45 lines
1.9 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Contains 2D clipping routines
  4. //
  5. // $Revision: $
  6. // $NoKeywords: $
  7. //=============================================================================//
  8. #ifndef CLIP2D_H
  9. #define CLIP2D_H
  10. namespace vgui
  11. {
  12. struct Vertex_t;
  13. }
  14. //-----------------------------------------------------------------------------
  15. // Enable/disable scissoring...
  16. //-----------------------------------------------------------------------------
  17. void EnableScissor( bool enable );
  18. //-----------------------------------------------------------------------------
  19. // For simulated scissor tests...
  20. //-----------------------------------------------------------------------------
  21. void SetScissorRect( int left, int top, int right, int bottom );
  22. void GetScissorRect( int &left, int &top, int &right, int &bottom, bool &enabled );
  23. //-----------------------------------------------------------------------------
  24. // Clips a line segment to the current scissor rectangle
  25. //-----------------------------------------------------------------------------
  26. bool ClipLine( const vgui::Vertex_t *pInVerts, vgui::Vertex_t* pOutVerts );
  27. //-----------------------------------------------------------------------------
  28. // Purpose: Does a scissor clip of the input rectangle.
  29. // Returns false if it is completely clipped off.
  30. //-----------------------------------------------------------------------------
  31. bool ClipRect( const vgui::Vertex_t &inUL, const vgui::Vertex_t &inLR,
  32. vgui::Vertex_t *pOutUL, vgui::Vertex_t *pOutLR );
  33. //-----------------------------------------------------------------------------
  34. // Clips a polygon to the screen area
  35. //-----------------------------------------------------------------------------
  36. int ClipPolygon( int iCount, vgui::Vertex_t *pVerts, int iTranslateX, int iTranslateY, vgui::Vertex_t ***pppOutVertex );
  37. #endif // CLIP2D_H