Counter Strike : Global Offensive Source Code
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.

82 lines
3.0 KiB

  1. //===== Copyright � 1996-2009, Valve Corporation, All rights reserved. ======//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //
  7. //===========================================================================//
  8. #ifndef PLATWINDOW_H
  9. #define PLATWINDOW_H
  10. #ifdef COMPILER_MSVC32
  11. #pragma once
  12. #endif
  13. #include "tier0/platform.h"
  14. #include "tier0/basetypes.h"
  15. //-----------------------------------------------------------------------------
  16. // Window handle
  17. //-----------------------------------------------------------------------------
  18. DECLARE_POINTER_HANDLE( PlatWindow_t );
  19. #define PLAT_WINDOW_INVALID ( (PlatWindow_t)0 )
  20. //-----------------------------------------------------------------------------
  21. // Window creation
  22. //-----------------------------------------------------------------------------
  23. enum WindowCreateFlags_t
  24. {
  25. WINDOW_CREATE_FULLSCREEN = 0x1,
  26. WINDOW_CREATE_RESIZING = 0x2,
  27. };
  28. PLATFORM_INTERFACE PlatWindow_t Plat_CreateWindow( void *hInstance, const char *pTitle, int nWidth, int nHeight, int nFlags );
  29. //-----------------------------------------------------------------------------
  30. // Window title
  31. //-----------------------------------------------------------------------------
  32. PLATFORM_INTERFACE void Plat_SetWindowTitle( PlatWindow_t hWindow, const char *pTitle );
  33. //-----------------------------------------------------------------------------
  34. // Window movement
  35. //-----------------------------------------------------------------------------
  36. PLATFORM_INTERFACE void Plat_SetWindowPos( PlatWindow_t hWindow, int x, int y );
  37. //-----------------------------------------------------------------------------
  38. // Gets the desktop resolution
  39. //-----------------------------------------------------------------------------
  40. PLATFORM_INTERFACE void Plat_GetDesktopResolution( int *pWidth, int *pHeight );
  41. //-----------------------------------------------------------------------------
  42. // Gets a window size
  43. //-----------------------------------------------------------------------------
  44. PLATFORM_INTERFACE void Plat_GetWindowClientSize( PlatWindow_t hWindow, int *pWidth, int *pHeight );
  45. //-----------------------------------------------------------------------------
  46. // Is the window minimized?
  47. //-----------------------------------------------------------------------------
  48. PLATFORM_INTERFACE bool Plat_IsWindowMinimized( PlatWindow_t hWindow );
  49. //-----------------------------------------------------------------------------
  50. // Gets the shell window in a console app
  51. //-----------------------------------------------------------------------------
  52. PLATFORM_INTERFACE PlatWindow_t Plat_GetShellWindow( );
  53. //-----------------------------------------------------------------------------
  54. // Convert window -> Screen coordinates and back
  55. //-----------------------------------------------------------------------------
  56. PLATFORM_INTERFACE void Plat_WindowToScreenCoords( PlatWindow_t hWnd, int &x, int &y );
  57. PLATFORM_INTERFACE void Plat_ScreenToWindowCoords( PlatWindow_t hWnd, int &x, int &y );
  58. #endif // PLATWINDOW_H