Searching for myself
-
Автор темы
- #1
Создал окно через imgui с viewports. Но закрыть его нормально не могу, окно не отзывается, думаю трабл в wndproc.
C++:
LRESULT __attribute__((__stdcall__)) event_handler( const HWND hwnd,
const UINT msg,
const WPARAM w_param,
const LPARAM l_param ) noexcept {
core::directx_render::get_instance( ).render_event( hwnd, msg, w_param, l_param );
return ::DefWindowProcA( hwnd, msg, w_param, l_param );
}
long directx_render::render_event( HWND hwnd, UINT msg, WPARAM w_param, LPARAM l_param ) {
if ( ::ImGui_ImplWin32_WndProcHandler( hwnd, msg, w_param, l_param ) != 0 )
return 1;
switch ( msg ) {
case WM_SIZE:
if ( m_device != nullptr && w_param != SIZE_MINIMIZED ) {
cleanup_render_target( );
m_swap_chain->ResizeBuffers( 0, LOWORD( l_param ), HIWORD( l_param ), DXGI_FORMAT_UNKNOWN, 0 );
create_render_target( );
}
break;
case WM_DESTROY:
::PostQuitMessage( 0 );
break;
default:
break;
}
return 0;
}