Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDL2 Integration? #62

Open
hydexon opened this issue May 27, 2020 · 1 comment
Open

SDL2 Integration? #62

hydexon opened this issue May 27, 2020 · 1 comment
Labels

Comments

@hydexon
Copy link

hydexon commented May 27, 2020

Hi, i've noticed this an revived fork of the good ol' OIS input system, which i've used in OGRE long ago. and i want to ask if there's SDL2 integration because my project already uses it for windowing and some utility functions, and i saw the codebase there's SDL support in the repo, but i can't find some option switch in the CMake files.

There's some SDL2 support on the works, or still WIP?
Thanks.

@mathisloge
Copy link

mathisloge commented Jun 5, 2020

you can get it working with

        OIS::ParamList pl;
        SDL_SysWMinfo wmInfo;
        SDL_VERSION(&wmInfo.version);
        SDL_GetWindowWMInfo(window, &wmInfo);
        std::ostringstream wnd;
#if defined OIS_WIN32_PLATFORM
        HWND hwnd = (HWND)wmInfo.info.win.window;
        wnd << (size_t)hwnd;
#elif defined OIS_LINUX_PLATFORM
        Window lnx_win = (Window)wmInfo.info.x11.window;
        wnd << (size_t)lnx_win;
#else
#error "Unknown platform"
#endif
        pl.insert(std::make_pair(std::string("WINDOW"), wnd.str()));

Where window is a SDL_Window*

but I don't have a deeper integration into SDL itself. For my purposes this is enough

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

No branches or pull requests

3 participants