/
redgpu
/
ezEngine
Обзор
Документация
Войти
/
redgpu
/
ezEngine
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
dev
Code/Engine/Foundation/Platform/Win/Utils/IncludeWindows.h
64 строки
2 KB
Jan Krassnigg
Refactor of platform specific includes (#1414)
23 окт 2024, 10:09
Не верифицирован
23 окт 2024, 10:09
74f6d97
Код
Авторство
О чём код?
#pragma once #include <Foundation/Basics.h> #define EZ_INCLUDED_WINDOWS_H 1 #if EZ_ENABLED(EZ_PLATFORM_WINDOWS) // this is important for code that wants to include winsock2.h later on # define _WINSOCKAPI_ /* Prevent inclusion of winsock.h in windows.h */ // already includes Windows.h, but defines important other things first // #include <winsock2.h> # ifndef WIN32_LEAN_AND_MEAN # define WIN32_LEAN_AND_MEAN # endif # include <Windows.h> // unset windows macros # undef min # undef max # undef GetObject # undef ERROR # undef DeleteFile # undef CopyFile # undef DispatchMessage # undef PostMessage # undef SendMessage # undef OPAQUE # undef SetPort # include <Foundation/Platform/Win/Utils/MinWindows.h> namespace ezMinWindows { template <> struct ToNativeImpl<HINSTANCE> { using type = ::HINSTANCE; static EZ_ALWAYS_INLINE ::HINSTANCE ToNative(HINSTANCE hInstance) { return reinterpret_cast<::HINSTANCE>(hInstance); } }; template <> struct ToNativeImpl<HWND> { using type = ::HWND; static EZ_ALWAYS_INLINE ::HWND ToNative(HWND hWnd) { return reinterpret_cast<::HWND>(hWnd); } }; template <> struct FromNativeImpl<::HWND> { using type = HWND; static EZ_ALWAYS_INLINE HWND FromNative(::HWND hWnd) { return reinterpret_cast<HWND>(hWnd); } }; template <> struct FromNativeImpl<::HINSTANCE> { using type = HINSTANCE; static EZ_ALWAYS_INLINE HINSTANCE FromNative(::HINSTANCE hInstance) { return reinterpret_cast<HINSTANCE>(hInstance); } }; } // namespace ezMinWindows #endif