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
1.9 KiB

  1. //========= Copyright Valve Corporation, All rights reserved. ============//
  2. //
  3. // Purpose:
  4. //
  5. // $NoKeywords: $
  6. //=============================================================================//
  7. #ifndef D3DAPP_H
  8. #define D3DAPP_H
  9. #ifdef _WIN32
  10. #pragma once
  11. #endif
  12. #include <d3d8.h>
  13. // Globals for the app to access. These are valid whenever the app is called.
  14. extern IDirect3D8 *g_pDirect3D;
  15. extern IDirect3DDevice8 *g_pDevice;
  16. // Special keys.
  17. #define APPKEY_LBUTTON -1
  18. #define APPKEY_RBUTTON -2
  19. #define APPKEY_SPACE -3
  20. // ------------------------------------------------------------------------------------ //
  21. // Functions for the app to provide.
  22. // ------------------------------------------------------------------------------------ //
  23. void AppInit();
  24. // Called to update or render the view as often as possible. If bInvalidRect is true,
  25. // then you should always render, so the window's contents are valid.
  26. void AppRender( float frametime, float mouseDeltaX, float mouseDeltaY, bool bInvalidRect );
  27. // Release any D3D objects you have here - a resize will happen.
  28. void AppPreResize();
  29. void AppPostResize();
  30. void AppExit( );
  31. void AppKey( int key, int down );
  32. void AppChar( int key );
  33. // ------------------------------------------------------------------------------------ //
  34. // Functions the app can call.
  35. // ------------------------------------------------------------------------------------ //
  36. // Show an error dialog and quit.
  37. bool Sys_Error(const char *pMsg, ...);
  38. // Shutdown the app. AppExit() will be called.
  39. void Sys_Quit();
  40. void Sys_SetWindowText( char const *pMsg, ... );
  41. // Key can be an ASCII key code or an APPKEY_ define.
  42. bool Sys_GetKeyState( int key );
  43. void Sys_Sleep( int ms );
  44. // Does the app have the focus?
  45. bool Sys_HasFocus();
  46. char const* Sys_FindArg( char const *pArg, char const *pDefault=NULL );
  47. int Sys_FindArgInt( char const *pArg, int defaultVal = -1 );
  48. int Sys_ScreenWidth();
  49. int Sys_ScreenHeight();
  50. #endif // D3DAPP_H