My company would like to use SDL2 for an OpenGL project. However, it requires creating our own Windows device context in order to use Nvidia specific extensions for assigning GPU affinity.
Is there a realistic path to accomplish this? We are willing to modify source code if it’s not too drastic.
Do you want to use wglCreateAffinityDCNV? I don’t have Windows with nvidia at the moment, but maybe you can get HWND from your HDC (WindowFromDC) and use SDL_CreateWindowFrom (maybe you’ll have to fiddle with OpenGL hints/flags)
I didn’t know about SDL_CreateWindowFrom(). This might do what we need! I assume it will create its own context which is not affinity so there might be a hack involved to replace that.
To use Nvidia’s GPU affinity context it has to be created using a device context that is assigned a GPU using Nvidia calls. So to use SDL it requires a way to create both the device context and the OpenGL context that SDL uses. It might require altering the source code, but hopefully very little.