text: #include "nlpch.h"
  #include "WindowsInput.h"
  #include "Neural/Core/Application.h"
  
  #include <GLFW/glfw3.h>
  
  namespace Neural 
  {
  	Input* Input::m_Instance = new WindowsInput;
  
  	bool WindowsInput::isKeyPressedImpl(int keycode)
  	{
  		auto window = static_cast<GLFWwindow*>(Application::get().getWindow().getNativeWindow());
  		auto state = glfwGetKey(window, keycode);
  		return state == GLFW_PRESS || state == GLFW_REPEAT;
  	}
  
  	bool WindowsInput::isMouseButtonPressedImpl(int button)
  	{
  		auto window = static_cast<GLFWwindow*>(Application::get().getWindow().getNativeWindow());
  		auto state = glfwGetMouseButton(window, button);
  		return state == GLFW_PRESS;
  	}
  
  	MousePosition WindowsInput::getMousePositionImpl()
  	{
  		auto window = static_cast<GLFWwindow*>(Application::get().getWindow().getNativeWindow());
  		double xpos, ypos;
  		glfwGetCursorPos(window, &xpos, &ypos);
  		return { (float)xpos, (float)ypos };
  	}
  }