I see, thanks for the help it helped me understand better.
Do i have to use Win32 API if i want to use DirectX11?
As followup, since I started doing this to my own personal project in preparation for emscripten support, getting the native handle is quite easy as you just need to use SDL_GetWindowWMInfo():
// extra header needed for SDL_GetWindowWMInfo and SDL_SysWMInfo
#include <SDL_syswm.h>
int main() {
// initialize SDL and create window
SDL_Init(0);
SDL_Window* window = SDL_CreateWindow("", 0, 0, 0, 0, 0);
// retrieve native handle info
SDL_SysWMInfo info;
SDL_VERSION(&info.version); // required before calling GetWindowWMInfo!
SDL_GetWindowWMInfo(window, &info);
// this bit is Win32-specific, but then so is D3D;
// other OSes have different sub-structs here
HWND handle = info.info.win.window;
do_stuff_with_handle(handle);
}
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement