Skip to content
This repository has been archived by the owner on Sep 7, 2021. It is now read-only.

integrate with SFML #57

Open
Arthapz opened this issue Jul 30, 2018 · 2 comments
Open

integrate with SFML #57

Arthapz opened this issue Jul 30, 2018 · 2 comments

Comments

@Arthapz
Copy link

Arthapz commented Jul 30, 2018

Hi,
how can i integrate Gainput with SFML, SFML expose only the Window ID, and how to integrate gainput event handling with sfml event Handling ?

@RicoP
Copy link

RicoP commented Jul 31, 2018

I guess you can just get the native window handle with GetActiveWindow

https://msdn.microsoft.com/en-us/library/windows/desktop/ms646292(v=vs.85).aspx

@Arthapz
Copy link
Author

Arthapz commented Jul 31, 2018

Sorry, i forgot to specifying that i'm on Linux environnement (and SFML expose Window handle but not Display handle),
i managed this issue by writting my own library that expose directly the natives event (on WinAPI / X11)

window::Event event;
#ifdef STORM_OS_LINUX
XEvent xevent;
while(m_window->pollEvent(event, &xevent)) {
    m_input_manager.HandleEvent(xevent);
#else
while(m_window->pollEvent(event)) {
#endif

but i think a solution to this issue can be useful for other peoples

(sorry for my english, this is not my primary language)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants