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.

75 lines
2.5 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose: Methods associated with the cursor
  4. //
  5. // $Revision: $
  6. // $NoKeywords: $
  7. //=============================================================================//
  8. #ifndef MATSURFACE_CURSOR_H
  9. #define MATSURFACE_CURSOR_H
  10. #ifdef _WIN32
  11. #pragma once
  12. #endif
  13. #include "VGuiMatSurface/IMatSystemSurface.h"
  14. #include <vgui/Cursor.h>
  15. //-----------------------------------------------------------------------------
  16. // Initializes cursors
  17. //-----------------------------------------------------------------------------
  18. void InitCursors();
  19. //-----------------------------------------------------------------------------
  20. // Selects a cursor
  21. //-----------------------------------------------------------------------------
  22. void CursorSelect(vgui::HCursor hCursor);
  23. //-----------------------------------------------------------------------------
  24. // Activates the current cursor
  25. //-----------------------------------------------------------------------------
  26. void ActivateCurrentCursor();
  27. //-----------------------------------------------------------------------------
  28. // Handles software cursors
  29. //-----------------------------------------------------------------------------
  30. void EnableSoftwareCursor( bool bEnable );
  31. bool ShouldDrawSoftwareCursor();
  32. int GetSoftwareCursorTexture( float *px, float *py );
  33. //-----------------------------------------------------------------------------
  34. // handles mouse movement
  35. //-----------------------------------------------------------------------------
  36. void CursorSetPos(void *hwnd, int x, int y);
  37. void CursorGetPos(void *hwnd, int &x, int &y);
  38. //-----------------------------------------------------------------------------
  39. // Purpose: prevents vgui from changing the cursor
  40. //-----------------------------------------------------------------------------
  41. void LockCursor( bool bEnable );
  42. //-----------------------------------------------------------------------------
  43. // Purpose: unlocks the cursor state
  44. //-----------------------------------------------------------------------------
  45. bool IsCursorLocked();
  46. //-----------------------------------------------------------------------------
  47. // Purpose: loads a custom cursor file from the file system
  48. //-----------------------------------------------------------------------------
  49. vgui::HCursor Cursor_CreateCursorFromFile( char const *curOrAniFile, char const *pPathID );
  50. // Helper for shutting down cursors
  51. void Cursor_ClearUserCursors();
  52. #endif // MATSURFACE_CURSOR_H