projectM-visualizer / frontend-sdl-cpp

Standalone application based on libSDL that turns your desktop audio into awesome visuals. Available on most platforms supported by both libprojectM and libSDL.
GNU General Public License v3.0
66 stars 35 forks source link

Add "WID" parameter for xwinwrap support #61

Closed ashley-graves closed 1 year ago

kblaschke commented 1 year ago

I guess this will help embedding the output into an pre-existing window/view, right?

If so, I'd suggest also setting the SDL_HINT_VIDEO_WINDOW_SHARE_PIXEL_FORMAT hint in addition to SDL_HINT_VIDEO_FOREIGN_WINDOW_OPENGL, so it'll also work for Windows users by passing an hWND handle.

Also, check for the SDL version used to compile. This hint was introduced in SDL 2.0.22, so with earlier versions it won't compile (like our build check on Ubuntu 22). If this hint is necessary, better make the whole feature dependent on the compile-time SDL library. Otherwise, check the hint availability with an #ifdef, similar to the monitor device hint for audio capturing.

As hints will only work on SDL libraries supporting them, using older SDL2 libraries will probably nor do what is intended. This should be documented somewhere, e.g. in the ReadMe, similar to the capture device support.

ashley-graves commented 1 year ago

I've only tried (and used) this on Linux using the latest SDL2 library from the Arch repos so far.

kblaschke commented 1 year ago

No updates to this PR for several months now, will close it for now.

If there's any update to the code to bring it into a state that can be merged and also compiles/works with all supported platforms, please feel free to open a new PR!