1

I am working with an existing OpenGL library which needs to be augmented with other UI functions (better keyboard input, mouse handling, etc). I was hoping to use SDL, SFML or GLFW with the existing OpenGL API to facilitate this. Using any of these frameworks, is it possible to hook UI functions from any of these frameworks into an existing window, rather than a window directly created from these frameworks?

-The existing OpenGL window is already created by the library I'm forced to use.

-I'm aware of the SDL_WINDOW_FOREIGN bit set but am not sure how this is supposed to work.

-Is there a better strategy for simply detecting mouse/keyboard input?

1
  • 1
    If you can get the system window handle of your OpenGL window then you can create a SFML window with this constructor of sf::Window. Depending on how your library works it might work with SFML.
    – Hiura
    Commented Nov 17, 2014 at 17:38

1 Answer 1

1

The SDL 2.0 function SDL_CreateWindowFrom() can set up SDL for input and rendering from a given native window.

https://wiki.libsdl.org/SDL_CreateWindowFrom

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.