forked from TheCherno/Hazel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
compile time check of window type and input type (TheCherno#190)
Adds Window::Create and Input::Create function into one place
- Loading branch information
1 parent
3531a50
commit 554fb3f
Showing
5 changed files
with
44 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include "hzpch.h" | ||
#include "Hazel/Core/Input.h" | ||
|
||
#ifdef HZ_PLATFORM_WINDOWS | ||
#include "Platform/Windows/WindowsInput.h" | ||
#endif | ||
|
||
namespace Hazel { | ||
|
||
Scope<Input> Input::s_Instance = Input::Create(); | ||
|
||
Scope<Input> Input::Create() | ||
{ | ||
#ifdef HZ_PLATFORM_WINDOWS | ||
return CreateScope<WindowsInput>(); | ||
#else | ||
HZ_CORE_ASSERT(false, "Unknown platform!"); | ||
return nullptr; | ||
#endif | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include "hzpch.h" | ||
#include "Hazel/Core/Window.h" | ||
|
||
#ifdef HZ_PLATFORM_WINDOWS | ||
#include "Platform/Windows/WindowsWindow.h" | ||
#endif | ||
|
||
namespace Hazel | ||
{ | ||
|
||
Scope<Window> Window::Create(const WindowProps& props) | ||
{ | ||
#ifdef HZ_PLATFORM_WINDOWS | ||
return CreateScope<WindowsWindow>(props); | ||
#else | ||
HZ_CORE_ASSERT(false, "Unknown platform!"); | ||
return nullptr; | ||
#endif | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters