Counter Strike : Global Offensive Source Code
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.

42 lines
1.9 KiB

  1. //========= Copyright � 1996-2005, 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. #include "vgui/ISurface.h"
  11. //-----------------------------------------------------------------------------
  12. // Enable/disable scissoring...
  13. //-----------------------------------------------------------------------------
  14. void EnableScissor( bool enable );
  15. //-----------------------------------------------------------------------------
  16. // For simulated scissor tests...
  17. //-----------------------------------------------------------------------------
  18. void SetScissorRect( int left, int top, int right, int bottom );
  19. void GetScissorRect( int &left, int &top, int &right, int &bottom, bool &enabled );
  20. //-----------------------------------------------------------------------------
  21. // Clips a line segment to the current scissor rectangle
  22. //-----------------------------------------------------------------------------
  23. bool ClipLine( const vgui::Vertex_t *pInVerts, vgui::Vertex_t* pOutVerts );
  24. //-----------------------------------------------------------------------------
  25. // Purpose: Does a scissor clip of the input rectangle.
  26. // Returns false if it is completely clipped off.
  27. //-----------------------------------------------------------------------------
  28. bool ClipRect( const vgui::Vertex_t &inUL, const vgui::Vertex_t &inLR,
  29. vgui::Vertex_t *pOutUL, vgui::Vertex_t *pOutLR );
  30. //-----------------------------------------------------------------------------
  31. // Clips a polygon to the screen area
  32. //-----------------------------------------------------------------------------
  33. int ClipPolygon( int iCount, vgui::Vertex_t *pVerts, int iTranslateX, int iTranslateY, vgui::Vertex_t ***pppOutVertex );
  34. #endif // CLIP2D_H