Now, the point is that I have another window (DirectX), this window is intended to be full screen and so I’d like to get the mouse and keyboards events attached to this one.
The question is: how can I ‘transfer’ the handling of mouse & keyboard from the framework primary window to the new one?
Was this other window created by Panda, and does it have a GraphicsWindow associated with it? If so, why not just call enable_keyboard() on that window in the first place? Or, if there is some reason you had to call enable_keyboard() on the main window first, and then opened the second window later, then you will have to forego the high-level enable_keyboard() method, and create the lower-level structures individually. Basically all you need is a MouseAndKeyboard and ButtonThrower object in Panda’s data graph; this is what enable_keyboard() does.
If it’s created outside of Panda, then Panda has no access to its window events, and you will need to have some other mechanism to read the window events from there and feed them into the Panda event handler.
Well, the window was created in the c++ Panda-3D program, but this way :
hWnd =CreateWindowEx(NULL,
L"WindowClass1", // name of the window class
L"my_dx", // title of the window
WS_EX_TOPMOST | WS_POPUP, // fullscreen values
0,// x-position of the window
0,// y-position of the window
dx_ImageWidth, // width of the window
dx_ImageHeight, // height of the window
NULL, // we have no parent windowNULL
NULL, // we aren't using menus, NULL
hInstance, // application handle
NULL); // used with multiple windows,NULL
The aim is to use it with DirectX (actually I pass the hwnd to directx stuff)
Now the question may be: could this window be created by Panda and its hwnd passed to DirectX?
If yes, I’d need to get access to the hwnd once the panda window is created.
Any particular reason you’re not just running Panda in DirectX mode, and using the Panda window directly, instead of all of this OpenGL-to-DirectX trouble?
You can get the HWND from a Panda-created window with win->get_window_handle()->get_os_handle()->get_int_handle().
I think you’ll find that most DirectX 11 features are also available as OpenGL extensions. It’s probably easier to work with those than to try and combine OpenGL and DirectX.
I agree and that’s precisely the point, and this is why I’m not using “load-display pandadx9”
Now I have to leave room for some DirectX stuff since on top of other things I’m getting hooked to Directshow… and here I have no choice.
Hence this explains my mixture of OpenGL and DirectX .