BsPlatformWndProc.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #pragma once
  2. #include "BsPlatform.h"
  3. #include "BsWin32Defs.h"
  4. namespace BansheeEngine
  5. {
  6. /**
  7. * @brief Contains the main message loop
  8. *
  9. * @note This is separated from the main Platform because we don't want to include various Windows
  10. * defines in a lot of our code that includes "Platform.h".
  11. */
  12. class BS_CORE_EXPORT PlatformWndProc : public Platform
  13. {
  14. public:
  15. /**
  16. * @brief Main message loop callback that processes messages received from windows.
  17. */
  18. static LRESULT CALLBACK _win32WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
  19. private:
  20. static bool isShiftPressed;
  21. static bool isCtrlPressed;
  22. /**
  23. * @brief Translate engine non client area to win32 non client area.
  24. */
  25. static LRESULT translateNonClientAreaType(NonClientAreaBorderType type);
  26. /**
  27. * @brief Method triggerend whenever a mouse event happens.
  28. */
  29. static void getMouseData(HWND hWnd, WPARAM wParam, LPARAM lParam, Vector2I& mousePos, OSPointerButtonStates& btnStates);
  30. /**
  31. * @brief Converts a virtual key code into an input command, if possible. Returns true
  32. * if conversion was done.
  33. */
  34. static bool getCommand(unsigned int virtualKeyCode, InputCommandType& command);
  35. };
  36. }