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.

94 lines
2.6 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. //=============================================================================//
  6. #ifndef VIEW_SHAREDV1_H
  7. #define VIEW_SHAREDV1_H
  8. #ifdef _WIN32
  9. #pragma once
  10. #endif
  11. //-----------------------------------------------------------------------------
  12. // Purpose: Renderer setup data.
  13. //-----------------------------------------------------------------------------
  14. class CViewSetupV1
  15. {
  16. public:
  17. CViewSetupV1()
  18. {
  19. m_bForceAspectRatio1To1 = false;
  20. m_bRenderToSubrectOfLargerScreen = false;
  21. bForceClearWholeRenderTarget = false;
  22. m_bUseRenderTargetAspectRatio = false;
  23. }
  24. // shared by 2D & 3D views
  25. // User specified context
  26. int context;
  27. // left side of view window
  28. int x;
  29. // top side of view window
  30. int y;
  31. // width of view window
  32. int width;
  33. // height of view window
  34. int height;
  35. // clear the color buffer before rendering this view?
  36. bool clearColor;
  37. // clear the Depth buffer before rendering this view?
  38. bool clearDepth;
  39. // NOTE: This is for a workaround on ATI with building cubemaps. Clearing just the viewport doesn't seem to work properly.
  40. bool bForceClearWholeRenderTarget;
  41. // the rest are only used by 3D views
  42. // Orthographic projection?
  43. bool m_bOrtho;
  44. // View-space rectangle for ortho projection.
  45. float m_OrthoLeft;
  46. float m_OrthoTop;
  47. float m_OrthoRight;
  48. float m_OrthoBottom;
  49. // horizontal FOV in degrees
  50. float fov;
  51. // horizontal FOV in degrees for in-view model
  52. float fovViewmodel;
  53. // 3D origin of camera
  54. Vector origin;
  55. // Origin gets reflected on the water surface, but things like
  56. // displacement LOD need to be calculated from the viewer's
  57. // real position.
  58. Vector m_vUnreflectedOrigin;
  59. // heading of camera (pitch, yaw, roll)
  60. QAngle angles;
  61. // local Z coordinate of near plane of camera
  62. float zNear;
  63. // local Z coordinate of far plane of camera
  64. float zFar;
  65. // local Z coordinate of near plane of camera ( when rendering view model )
  66. float zNearViewmodel;
  67. // local Z coordinate of far plane of camera ( when rendering view model )
  68. float zFarViewmodel;
  69. bool m_bForceAspectRatio1To1;
  70. // set to true if this is to draw into a subrect of the larger screen
  71. // this really is a hack, but no more than the rest of the way this class is used
  72. bool m_bRenderToSubrectOfLargerScreen;
  73. // Use this for situations like water where you want to render the aspect ratio of the
  74. // back buffer into a square (or otherwise) render target.
  75. bool m_bUseRenderTargetAspectRatio;
  76. };
  77. #endif // VIEW_SHAREDV1_H