diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /public/tier2/renderutils.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'public/tier2/renderutils.h')
| -rw-r--r-- | public/tier2/renderutils.h | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/public/tier2/renderutils.h b/public/tier2/renderutils.h new file mode 100644 index 0000000..fe3d87c --- /dev/null +++ b/public/tier2/renderutils.h @@ -0,0 +1,69 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: A set of utilities to render standard shapes +// +//===========================================================================// + +#ifndef RENDERUTILS_H +#define RENDERUTILS_H + +#ifdef _WIN32 +#pragma once +#endif + +#include "tier2/tier2.h" +#include "Color.h" + +//----------------------------------------------------------------------------- +// Forward declarations +//----------------------------------------------------------------------------- +class Vector; +class QAngle; +class IMaterial; +struct matrix3x4_t; + + +// Renders a wireframe sphere +void RenderWireframeSphere( const Vector &vCenter, float flRadius, int nTheta, int nPhi, Color c, bool bZBuffer ); + +// Renders a sphere +void RenderSphere( const Vector &vCenter, float flRadius, int nTheta, int nPhi, Color c, bool bZBuffer ); +void RenderSphere( const Vector &vCenter, float flRadius, int nTheta, int nPhi, Color c, IMaterial *pMaterial ); + +// Renders a wireframe box relative to an origin +void RenderWireframeBox( const Vector &vOrigin, const QAngle& angles, const Vector &vMins, const Vector &vMaxs, Color c, bool bZBuffer ); + +// Renders a swept wireframe box +void RenderWireframeSweptBox( const Vector &vStart, const Vector &vEnd, const QAngle &angles, const Vector &vMins, const Vector &vMaxs, Color c, bool bZBuffer ); + +// Renders a solid box +void RenderBox( const Vector& origin, const QAngle& angles, const Vector& mins, const Vector& maxs, Color c, bool bZBuffer, bool bInsideOut = false ); +void RenderBox( const Vector& origin, const QAngle& angles, const Vector& mins, const Vector& maxs, Color c, IMaterial *pMaterial, bool bInsideOut = false ); + +// Renders axes, red->x, green->y, blue->z (axis aligned) +void RenderAxes( const Vector &vOrigin, float flScale, bool bZBuffer ); +void RenderAxes( const matrix3x4_t &transform, float flScale, bool bZBuffer ); + +// Render a line +void RenderLine( const Vector& v1, const Vector& v2, Color c, bool bZBuffer ); + +// Draws a triangle +void RenderTriangle( const Vector& p1, const Vector& p2, const Vector& p3, Color c, bool bZBuffer ); +void RenderTriangle( const Vector& p1, const Vector& p2, const Vector& p3, Color c, IMaterial *pMaterial ); + +// Draws a axis-aligned quad +void RenderQuad( IMaterial *pMaterial, float x, float y, float w, float h, float z, float s0, float t0, float s1, float t1, const Color& clr ); + +// Renders a screen space quad +void DrawScreenSpaceRectangle( IMaterial *pMaterial, + int nDestX, int nDestY, int nWidth, int nHeight, // Rect to draw into in screen space + float flSrcTextureX0, float flSrcTextureY0, // which texel you want to appear at destx/y + float flSrcTextureX1, float flSrcTextureY1, // which texel you want to appear at destx+width-1, desty+height-1 + int nSrcTextureWidth, int nSrcTextureHeight, // needed for fixup + void *pClientRenderable = NULL, // Used to pass to the bind proxies + int nXDice = 1, + int nYDice = 1, + float fDepth = 0.0 ); // what Z value to put in the verts + +#endif // RENDERUTILS_H + |