I have modified the repo.
I managed to have multiple windows rendering and made so that events are handled properly. I have one big problem and I haven’t learned enough of OpenGL and SDL yet to have a good idea of why they are happening. The other problems that I’m having are also tied to that function.
The big problem is that SDL_GL_MakeCurrent is veeery slow when swapping window.
And one other problem that I have is that my mainLoop is actually not doing things in the right order it seems. Currently, if a new App is created in the update function of another App (L.53 of App.hx), SDL automatically makes the new window the current target window, so when calling present() (L.64 of App.hx) which calls SDL_GL_SwapWindow, an error is made that says that the window that’s having its buffer swapped isn’t the current target, but it automatically sets the window as current I guess since nothing breaks.
The thing is, when I’m trying to not trigger that error by making sure that the right target is set after L.53 using renderTo() (see commented lines 55-57), SDL doesn’t emit an error but the rendering breaks, the windows become black.
Uncommenting L.35 of App.hx will break rendering too for some reason.
Welp, that’s how far I can go for now with my current knowledge. I’ll come back to it after understanding what’s happening in h3d.impl.GlDriver.hx I guess.
Edit : Oh, and there’s a hashlink build and the profiler file in the repo.