ZClip.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /*
  2. ===========================================================================
  3. Doom 3 GPL Source Code
  4. Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
  5. This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
  6. Doom 3 Source Code is free software: you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation, either version 3 of the License, or
  9. (at your option) any later version.
  10. Doom 3 Source Code is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. GNU General Public License for more details.
  14. You should have received a copy of the GNU General Public License
  15. along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
  16. In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
  17. If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
  18. ===========================================================================
  19. */
  20. #ifndef ZCLIP_H
  21. #define ZCLIP_H
  22. // I don't like doing macros without braces and with whitespace, but the compiler moans if I do these differently,
  23. // and since they're only for use within glColor3f() calls anyway then this is ok... (that's my excuse anyway)
  24. //
  25. #define ZCLIP_COLOUR 1.0f, 0.0f, 1.0f
  26. #define ZCLIP_COLOUR_DIM 0.8f, 0.0f, 0.8f
  27. class CZClip
  28. {
  29. public:
  30. CZClip();
  31. ~CZClip();
  32. int GetTop(void);
  33. int GetBottom(void);
  34. void SetTop(int iNewZ);
  35. void SetBottom(int iNewZ);
  36. void Reset(void);
  37. bool IsEnabled(void);
  38. bool Enable(bool bOnOff);
  39. void Paint(void);
  40. protected:
  41. void Legalise(void);
  42. bool m_bEnabled;
  43. int m_iZClipTop;
  44. int m_iZClipBottom;
  45. };
  46. #endif // #ifndef ZCLIP_H
  47. ///////////// eof ///////////////