summaryrefslogtreecommitdiff
path: root/vguimatsurface/Clip2D.h
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /vguimatsurface/Clip2D.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'vguimatsurface/Clip2D.h')
-rw-r--r--vguimatsurface/Clip2D.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/vguimatsurface/Clip2D.h b/vguimatsurface/Clip2D.h
new file mode 100644
index 0000000..b196920
--- /dev/null
+++ b/vguimatsurface/Clip2D.h
@@ -0,0 +1,46 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose: Contains 2D clipping routines
+//
+// $Revision: $
+// $NoKeywords: $
+//=============================================================================//
+
+#ifndef CLIP2D_H
+#define CLIP2D_H
+
+namespace vgui
+{
+ struct Vertex_t;
+}
+
+//-----------------------------------------------------------------------------
+// Enable/disable scissoring...
+//-----------------------------------------------------------------------------
+void EnableScissor( bool enable );
+
+//-----------------------------------------------------------------------------
+// For simulated scissor tests...
+//-----------------------------------------------------------------------------
+void SetScissorRect( int left, int top, int right, int bottom );
+void GetScissorRect( int &left, int &top, int &right, int &bottom, bool &enabled );
+
+//-----------------------------------------------------------------------------
+// Clips a line segment to the current scissor rectangle
+//-----------------------------------------------------------------------------
+bool ClipLine( const vgui::Vertex_t *pInVerts, vgui::Vertex_t* pOutVerts );
+
+
+//-----------------------------------------------------------------------------
+// Purpose: Does a scissor clip of the input rectangle.
+// Returns false if it is completely clipped off.
+//-----------------------------------------------------------------------------
+bool ClipRect( const vgui::Vertex_t &inUL, const vgui::Vertex_t &inLR,
+ vgui::Vertex_t *pOutUL, vgui::Vertex_t *pOutLR );
+
+//-----------------------------------------------------------------------------
+// Clips a polygon to the screen area
+//-----------------------------------------------------------------------------
+int ClipPolygon( int iCount, vgui::Vertex_t *pVerts, int iTranslateX, int iTranslateY, vgui::Vertex_t ***pppOutVertex );
+
+#endif // CLIP2D_H \ No newline at end of file