Open exphck1337 opened 5 years ago
Try calling nk_d3d9_handle_event in your WndProc hook and nk_input_begin, nk_input_end at the end of your render function (after nk_d3d9_render).
I tried, it did not work
How are you creating your WndProc hook? I've done something similar and I have never had your issue. Update your original post with your new code or post it again. Thanks.
I'm doing hook in WndProc with SetWindowLongPtrW(GWLP_WNDPROC), I updated the code
Very strange. Make sure your on_wnd_proc_hook
is actually being called.
Some relevant code from my old project:
void render() {
nk_begin(ctx_, "", nk_rect(50, 50, 400, 250), NK_WINDOW_MOVABLE | NK_WINDOW_TITLE);
nk_end(ctx_);
nk_d3d9_render(NK_ANTI_ALIASING_ON);
nk_input_begin(ctx_);
nk_input_end(ctx_);
}
LRESULT input(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
return nk_d3d9_handle_event(hwnd, msg, wparam, lparam);
}
LRESULT hk_wndproc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) {
if (menu->visible) {
if (menu->input(hwnd, msg, wparam, lparam)) {
return 0;
}
}
return CallWindowProcA(old_wndproc, hwnd, msg, wparam, lparam);
}
Hello, I am trying to use nuklear in a dll, but I am having problems with input, doesn't work in any way, I believe that is related to the functions nk_input_begin/nk_input_end, where they should be called on an internal?