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.

60 lines
1.6 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $Workfile: $
  6. // $Date: $
  7. // $NoKeywords: $
  8. //===========================================================================//
  9. #ifndef IGAME_H
  10. #define IGAME_H
  11. #ifdef _WIN32
  12. #pragma once
  13. #endif
  14. class IGame
  15. {
  16. public:
  17. virtual ~IGame( void ) { }
  18. virtual bool Init( void *pvInstance ) = 0;
  19. virtual bool Shutdown( void ) = 0;
  20. virtual bool CreateGameWindow( void ) = 0;
  21. virtual void DestroyGameWindow( void ) = 0;
  22. // This is used in edit mode to specify a particular game window (created by hammer)
  23. virtual void SetGameWindow( void* hWnd ) = 0;
  24. // This is used in edit mode to override the default wnd proc associated w/
  25. // the game window specified in SetGameWindow.
  26. virtual bool InputAttachToGameWindow() = 0;
  27. virtual void InputDetachFromGameWindow() = 0;
  28. virtual void PlayStartupVideos( void ) = 0;
  29. // This will be the SDL_Window* under SDL, the WindowRef under Mac, and
  30. // the HWND on Win32.
  31. virtual void* GetMainWindow( void ) = 0;
  32. // This will be the HWND under Direct3D, and the SDL_Window* or
  33. // WindowRef under GL.
  34. virtual void* GetMainDeviceWindow( void ) = 0;
  35. virtual void** GetMainWindowAddress( void ) = 0;
  36. virtual void GetDesktopInfo( int &width, int &height, int &refreshrate ) = 0;
  37. virtual void SetWindowXY( int x, int y ) = 0;
  38. virtual void SetWindowSize( int w, int h ) = 0;
  39. virtual void GetWindowRect( int *x, int *y, int *w, int *h ) = 0;
  40. // Not Alt-Tabbed away
  41. virtual bool IsActiveApp( void ) = 0;
  42. virtual void DispatchAllStoredGameMessages() = 0;
  43. };
  44. extern IGame *game;
  45. #endif // IGAME_H