I'm following this guide for OpenGL/OpenCL interop: Intel CL/GL interop tutorial
It says there I can use the function clGetGLContextInfoKHR to find the device currently associated with my OpenGL context. The function requires a list of parameters containing the OpenCL platform, the OpenGL context, and the device context (HDC) used to create the OpenGL context.
After googling it, I found thread that gives a method to get the HDC for an SDL window: thread They suggest using this code:
#ifdef _WIN32
SDL_SysWMinfo info;
SDL_VERSION(&info.version);
if ( SDL_GetWMInfo(&info) < 0 )
fail();
hwnd = info.window;
#endif
First off, it looks like it only works for Win32. Will it work for 64-bit Windows? And is there a way to do the same thing on Linux/OSX?
Second, when I compile it with MinGW-w64, I get an error "unknown type name 'SDL_SysWMinfo'". SDL_SysWMinfo can be found in the official docs, and I have the latest SDL version, so it should work. I'm guessing that type definition isn't in my SDL.h header file- is there another header file I need?