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.

48 lines
1.4 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //===========================================================================//
  7. #ifndef GL_RMAIN_H
  8. #define GL_RMAIN_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include "mathlib/vector.h"
  13. #include "mathlib/mathlib.h"
  14. extern Frustum_t g_Frustum;
  15. // Cull to the full screen frustum.
  16. inline bool R_CullBox( const Vector& mins, const Vector& maxs )
  17. {
  18. return R_CullBox( mins, maxs, g_Frustum );
  19. }
  20. inline bool R_CullBoxSkipNear( const Vector& mins, const Vector& maxs )
  21. {
  22. return R_CullBoxSkipNear( mins, maxs, g_Frustum );
  23. }
  24. // Draw a rectangle in screenspace. The screen window is (-1,-1) to (1,1).
  25. void R_DrawScreenRect( float left, float top, float right, float bottom );
  26. void R_DrawPortals();
  27. float GetScreenAspect( );
  28. void R_CheckForLightingConfigChanges();
  29. // Methods related to view/projection matrices
  30. void ComputeViewMatrix( VMatrix *pViewMatrix, const Vector &origin, const QAngle &angles );
  31. // NOTE: Projection coordinates are -1->1 in both dimensions
  32. // NOTE: Returns actual aspect ratio used
  33. float ComputeViewMatrices( VMatrix *pWorldToView, VMatrix *pViewToProjection, VMatrix *pWorldToProjection, const CViewSetup &viewSetup );
  34. // NOTE: Screen coordinates go from 0->w, 0->h
  35. void ComputeWorldToScreenMatrix( VMatrix *pWorldToScreen, const VMatrix &worldToProjection, const CViewSetup &viewSetup );
  36. #endif // GL_RMAIN_H