dllmain.cpp 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include <platform.h>
  9. #include <IEditor.h>
  10. #include <Include/IPlugin.h>
  11. #include "ComponentEntityEditorPlugin.h"
  12. #if AZ_TRAIT_OS_PLATFORM_APPLE || defined(AZ_PLATFORM_LINUX)
  13. typedef HANDLE HINSTANCE;
  14. #define DLL_PROCESS_ATTACH 1
  15. #endif
  16. IEditor* g_pEditor = nullptr;
  17. //------------------------------------------------------------------
  18. PLUGIN_API IPlugin* CreatePluginInstance(PLUGIN_INIT_PARAM* pInitParam)
  19. {
  20. g_pEditor = pInitParam->pIEditorInterface;
  21. ISystem* pSystem = pInitParam->pIEditorInterface->GetSystem();
  22. ModuleInitISystem(pSystem, "ComponentEntityEditorPlugin");
  23. return new ComponentEntityEditorPlugin(g_pEditor);
  24. }
  25. //------------------------------------------------------------------
  26. HINSTANCE g_hInstance = 0;
  27. BOOL __stdcall DllMain(HINSTANCE hinstDLL, ULONG fdwReason, [[maybe_unused]] LPVOID lpvReserved)
  28. {
  29. if (fdwReason == DLL_PROCESS_ATTACH)
  30. {
  31. g_hInstance = hinstDLL;
  32. }
  33. return TRUE;
  34. }