WolfOdrade
WolfOdrade

Reputation: 370

Hook SDL, SFML or GLFW into existing OpenGL application

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?

Upvotes: 1

Views: 1695

Answers (1)

Jonny D
Jonny D

Reputation: 2344

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

Upvotes: 1

Related Questions