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.

63 lines
3.2 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //=============================================================================//
  8. //
  9. // cdll_int.h
  10. //
  11. // 4-23-98
  12. // JOHN: client dll interface declarations
  13. //
  14. #ifndef IVDEBUGOVERLAY_H
  15. #define IVDEBUGOVERLAY_H
  16. #ifdef _WIN32
  17. #pragma once
  18. #endif
  19. class Vector;
  20. #define VDEBUG_OVERLAY_INTERFACE_VERSION "VDebugOverlay003"
  21. // When used as a duration by a server-side NDebugOverlay:: call,
  22. // causes the overlay to persist until the next server update.
  23. #define NDEBUG_PERSIST_TILL_NEXT_SERVER (0.0f)
  24. class OverlayText_t;
  25. abstract_class IVDebugOverlay
  26. {
  27. public:
  28. virtual void AddEntityTextOverlay(int ent_index, int line_offset, float duration, int r, int g, int b, int a, PRINTF_FORMAT_STRING const char *format, ...) = 0;
  29. virtual void AddBoxOverlay(const Vector& origin, const Vector& mins, const Vector& max, QAngle const& orientation, int r, int g, int b, int a, float duration) = 0;
  30. virtual void AddTriangleOverlay(const Vector& p1, const Vector& p2, const Vector& p3, int r, int g, int b, int a, bool noDepthTest, float duration) = 0;
  31. virtual void AddLineOverlay(const Vector& origin, const Vector& dest, int r, int g, int b,bool noDepthTest, float duration) = 0;
  32. virtual void AddTextOverlay(const Vector& origin, float duration, PRINTF_FORMAT_STRING const char *format, ...) = 0;
  33. virtual void AddTextOverlay(const Vector& origin, int line_offset, float duration, PRINTF_FORMAT_STRING const char *format, ...) = 0;
  34. virtual void AddScreenTextOverlay(float flXPos, float flYPos,float flDuration, int r, int g, int b, int a, const char *text) = 0;
  35. virtual void AddSweptBoxOverlay(const Vector& start, const Vector& end, const Vector& mins, const Vector& max, const QAngle & angles, int r, int g, int b, int a, float flDuration) = 0;
  36. virtual void AddGridOverlay(const Vector& origin) = 0;
  37. virtual int ScreenPosition(const Vector& point, Vector& screen) = 0;
  38. virtual int ScreenPosition(float flXPos, float flYPos, Vector& screen) = 0;
  39. virtual OverlayText_t *GetFirst( void ) = 0;
  40. virtual OverlayText_t *GetNext( OverlayText_t *current ) = 0;
  41. virtual void ClearDeadOverlays( void ) = 0;
  42. virtual void ClearAllOverlays() = 0;
  43. virtual void AddTextOverlayRGB(const Vector& origin, int line_offset, float duration, float r, float g, float b, float alpha, PRINTF_FORMAT_STRING const char *format, ...) = 0;
  44. virtual void AddTextOverlayRGB(const Vector& origin, int line_offset, float duration, int r, int g, int b, int a, PRINTF_FORMAT_STRING const char *format, ...) = 0;
  45. virtual void AddLineOverlayAlpha(const Vector& origin, const Vector& dest, int r, int g, int b, int a, bool noDepthTest, float duration) = 0;
  46. virtual void AddBoxOverlay2( const Vector& origin, const Vector& mins, const Vector& max, QAngle const& orientation, const Color& faceColor, const Color& edgeColor, float duration ) = 0;
  47. private:
  48. inline void AddTextOverlay(const Vector& origin, int line_offset, float duration, int r, int g, int b, int a, PRINTF_FORMAT_STRING const char *format, ...) {} /* catch improper use of bad interface. Needed because '0' duration can be resolved by compiler to NULL format string (i.e., compiles but calls wrong function) */
  49. };
  50. #endif // IVDEBUGOVERLAY_H