summaryrefslogtreecommitdiff
path: root/engine/gl_rmain.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 /engine/gl_rmain.h
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'engine/gl_rmain.h')
-rw-r--r--engine/gl_rmain.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/engine/gl_rmain.h b/engine/gl_rmain.h
new file mode 100644
index 0000000..950733d
--- /dev/null
+++ b/engine/gl_rmain.h
@@ -0,0 +1,48 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+// $NoKeywords: $
+//===========================================================================//
+
+#ifndef GL_RMAIN_H
+#define GL_RMAIN_H
+
+#ifdef _WIN32
+#pragma once
+#endif
+
+
+#include "mathlib/vector.h"
+#include "mathlib/mathlib.h"
+
+extern Frustum_t g_Frustum;
+
+// Cull to the full screen frustum.
+inline bool R_CullBox( const Vector& mins, const Vector& maxs )
+{
+ return R_CullBox( mins, maxs, g_Frustum );
+}
+inline bool R_CullBoxSkipNear( const Vector& mins, const Vector& maxs )
+{
+ return R_CullBoxSkipNear( mins, maxs, g_Frustum );
+}
+
+// Draw a rectangle in screenspace. The screen window is (-1,-1) to (1,1).
+void R_DrawScreenRect( float left, float top, float right, float bottom );
+
+void R_DrawPortals();
+float GetScreenAspect( );
+void R_CheckForLightingConfigChanges();
+
+// Methods related to view/projection matrices
+void ComputeViewMatrix( VMatrix *pViewMatrix, const Vector &origin, const QAngle &angles );
+
+// NOTE: Projection coordinates are -1->1 in both dimensions
+// NOTE: Returns actual aspect ratio used
+float ComputeViewMatrices( VMatrix *pWorldToView, VMatrix *pViewToProjection, VMatrix *pWorldToProjection, const CViewSetup &viewSetup );
+
+// NOTE: Screen coordinates go from 0->w, 0->h
+void ComputeWorldToScreenMatrix( VMatrix *pWorldToScreen, const VMatrix &worldToProjection, const CViewSetup &viewSetup );
+
+#endif // GL_RMAIN_H