In order to embed an SDL window into a JFrame, we need to create a dummy SDL window with OpenGL enabled and share the pixel format with the SDL window that will be embedded into another frame (this approach will remove crashes when resizing the SDL window in charge of the display). However, mixing OpenGL with SDL Renderer cause a crash when destroying the renderer during the cleaning phase (On windows: JVM crashes when destroying the player, ACCESS_Violation When destroying the renderer.)
The purpose of embedding the SDL window into a JFrame (or any other Window with window handle) is to forward the key events implemented in the Java Side (in our case is Datavyu) to the Native side, this option is postponed for now, the SDL Window is displayed in the Native Side, the safest way to handle events when the SDL window is in Focus is to dispatch the key event to the Java Side and process it there.
In order to embed an SDL window into a JFrame, we need to create a dummy SDL window with OpenGL enabled and share the pixel format with the SDL window that will be embedded into another frame (this approach will remove crashes when resizing the SDL window in charge of the display). However, mixing OpenGL with SDL Renderer cause a crash when destroying the renderer during the cleaning phase (On windows: JVM crashes when destroying the player, ACCESS_Violation When destroying the renderer.) The purpose of embedding the SDL window into a JFrame (or any other Window with window handle) is to forward the key events implemented in the Java Side (in our case is Datavyu) to the Native side, this option is postponed for now, the SDL Window is displayed in the Native Side, the safest way to handle events when the SDL window is in Focus is to dispatch the key event to the Java Side and process it there.