diff options
| author | Ellie Hermaszewska <ellieh@nvidia.com> | 2024-10-29 14:49:26 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-29 14:49:26 +0800 |
| commit | f65d756bff8d4c5cbc15bd0322a2ae8e6b896a21 (patch) | |
| tree | ea1d61342cd29368e19135000ec2948813096205 /tools/platform/window.h | |
| parent | a729c15e9dce9f5116a38afc66329ab2ca4cea54 (diff) | |
format
* format
* Minor test fixes
* enable checking cpp format in ci
Diffstat (limited to 'tools/platform/window.h')
| -rw-r--r-- | tools/platform/window.h | 75 |
1 files changed, 41 insertions, 34 deletions
diff --git a/tools/platform/window.h b/tools/platform/window.h index 29327def3..a419f85b9 100644 --- a/tools/platform/window.h +++ b/tools/platform/window.h @@ -1,13 +1,13 @@ // window.h #pragma once +#include "platform-api.h" #include "slang-com-ptr.h" #include "source/core/slang-basic.h" #include "source/core/slang-func-ptr.h" -#include "platform-api.h" - -namespace platform { +namespace platform +{ enum class KeyCode : uint32_t { @@ -139,8 +139,13 @@ struct ButtonState { enum Enum { - None = 0, LeftButton = 1, RightButton = 2, MiddleButton = 4, - Shift = 8, Control = 16, Alt = 32 + None = 0, + LeftButton = 1, + RightButton = 2, + MiddleButton = 4, + Shift = 8, + Control = 16, + Alt = 32 }; }; @@ -167,7 +172,8 @@ struct Rect enum class WindowStyle { - Default, FixedSize, + Default, + FixedSize, }; struct WindowDesc @@ -226,37 +232,38 @@ public: #ifdef _WIN32 -# ifdef _MSC_VER -# ifdef _DEBUG -# define GFX_DUMP_LEAK _CrtDumpMemoryLeaks(); -# endif -# endif -# ifndef GFX_DUMP_LEAK -# define GFX_DUMP_LEAK -# endif -# define PLATFORM_UI_MAIN(APPLICATION_ENTRY) \ - int __stdcall wWinMain( \ - void* /*instance*/, \ - void* /* prevInstance */, \ - void* /* commandLine */, \ - int /*showCommand*/) \ - { \ - platform::Application::init(); \ - auto result = APPLICATION_ENTRY(0, nullptr); \ - platform::Application::dispose(); \ - GFX_DUMP_LEAK \ - return result; \ - } +#ifdef _MSC_VER +#ifdef _DEBUG +#define GFX_DUMP_LEAK _CrtDumpMemoryLeaks(); +#endif +#endif +#ifndef GFX_DUMP_LEAK +#define GFX_DUMP_LEAK +#endif +#define PLATFORM_UI_MAIN(APPLICATION_ENTRY) \ + int __stdcall wWinMain( \ + void* /*instance*/, \ + void* /* prevInstance */, \ + void* /* commandLine */, \ + int /*showCommand*/ \ + ) \ + { \ + platform::Application::init(); \ + auto result = APPLICATION_ENTRY(0, nullptr); \ + platform::Application::dispose(); \ + GFX_DUMP_LEAK \ + return result; \ + } #else -#define PLATFORM_UI_MAIN(APPLICATION_ENTRY) \ - int main(int argc, char** argv) \ - { \ - platform::Application::init(); \ - auto rs = APPLICATION_ENTRY(argc, argv); \ - platform::Application::dispose(); \ - return rs; \ +#define PLATFORM_UI_MAIN(APPLICATION_ENTRY) \ + int main(int argc, char** argv) \ + { \ + platform::Application::init(); \ + auto rs = APPLICATION_ENTRY(argc, argv); \ + platform::Application::dispose(); \ + return rs; \ } #endif |
