Base layout for the input manager
This commit is contained in:
		
							
								
								
									
										14
									
								
								BarinkEngine/Include/Input/GLFWInput.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14
									
								
								BarinkEngine/Include/Input/GLFWInput.h
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,14 @@
 | 
			
		||||
#pragma once
 | 
			
		||||
#include "GLFW/glfw3.h"
 | 
			
		||||
 | 
			
		||||
namespace BarinkEngine {
 | 
			
		||||
	namespace Input {
 | 
			
		||||
 | 
			
		||||
		void BE_GLFW_KEYS(GLFWwindow* window, int key, int scancode, int action, int mods);
 | 
			
		||||
		void BE_GLFW_CURSOR_POSITION(GLFWwindow* window, double x, double y);
 | 
			
		||||
		void BE_GLFW_CURSOR_ENTER(GLFWwindow* window, int entered);
 | 
			
		||||
		void BE_GLFW_MOUSE_BUTTON(GLFWwindow* window, int button, int action, int mods);
 | 
			
		||||
		void BE_GLFW_SCROLL(GLFWwindow* window, double xoffset, double yoffset);
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
@ -1,27 +1,29 @@
 | 
			
		||||
#pragma once
 | 
			
		||||
#include <vector>
 | 
			
		||||
#include <list>
 | 
			
		||||
 | 
			
		||||
#include "Graphics/Window.h"
 | 
			
		||||
#include "EventSystem/EventEmitter.h"
 | 
			
		||||
#include "../Include/Input/GLFWInput.h"
 | 
			
		||||
#include "BarinkEngine.h"
 | 
			
		||||
 | 
			
		||||
namespace BarinkEngine {
 | 
			
		||||
 | 
			
		||||
	class InputManager : EventEmitter {
 | 
			
		||||
	class InputManager : public EventEmitter {
 | 
			
		||||
	public:
 | 
			
		||||
		InputManager();
 | 
			
		||||
 | 
			
		||||
		void PollEvents();
 | 
			
		||||
		
 | 
			
		||||
		void attach(BarinkWindow* window);
 | 
			
		||||
		void detach(BarinkWindow* window);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		void setupGLFWInput(GLFWwindow* window);
 | 
			
		||||
 | 
			
		||||
		// GLFW Handlers
 | 
			
		||||
		static void KeyCallback(GLFWwindow* window, int key, int scancode, int action, int mods);
 | 
			
		||||
		static void CursorPositionCallback(GLFWwindow* window, double x, double y);
 | 
			
		||||
		static void CursorEnterCallback(GLFWwindow* window, int entered);
 | 
			
		||||
		static void MouseButtonCallback(GLFWwindow* window, int button, int action, int mods);
 | 
			
		||||
		static void ScrollCallback(GLFWwindow* window, double xoffset, double yoffset);
 | 
			
		||||
 | 
			
		||||
	
 | 
			
		||||
	private:
 | 
			
		||||
		std::vector<BarinkWindow*> windows;
 | 
			
		||||
		std::list<BarinkWindow*> windows;
 | 
			
		||||
 | 
			
		||||
	};
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user