You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently working on a c# project and as you can see, the ImGui window is stuck on an invisible wall and cannot cross this limit. (the avalable area only covers a fifth of my screen, wich is problematic).
does anyone have any clue what's causing all of this ?
(Sorry, my project is written in c#, using modified cimgui [Implement backends for this])
(Sorry for can't post the real screenshot, but my issuse like this screenshot too)
Screenshots/Video:
Minimal, Complete and Verifiable Example code:
privatestaticstringClientName="DebugClient";privatestaticstringClientVersion="0.15.0";privatestaticstringClientTag="DEV";//Implement backends to cimgui is pain as f*ck//F*k the cimguiprivateunsafestaticvoidInit_Draw(IntPtrdevice,IntPtrhDc){try{if(ImGuiInited||pending)return;ImGui.CreateContext();InitStyle();pending=true;vario=ImGui.GetIO();io.WantSaveIniSettings=false;io.KeyNativeApi.CImguiWrapper.CImGui_ImplWin32_Init((void*)hwnd);switch(graphicType){caseGraphicsType.d3d9:NativeApi.CImguiWrapper.CImGui_ImplDX9_Init((void*)device);break;caseGraphicsType.opengl:Wgl.MakeCurrent(hDc,Wgl.GetCurrentContext());NativeApi.CImguiWrapper.CImGui_ImplOpenGL3_Init(null);break;default:thrownewException("Not support "+graphicType);}InitPage();GameBase=newGameBase();Player=newPlayer();NetworkClient=newNetworkClient();InputManager=newInputManager();AudioEngine=newAudioEngine();ImGuiInited=true;pending=false;Logging.Log("Debug GUI initialized");}catch(Exceptione){Logging.Log("Error!"+e.ToString());pending=false;}}privatestaticvoidBeginDraw(){switch(graphicType){caseGraphicsType.d3d9:NativeApi.CImguiWrapper.CImGui_ImplDX9_NewFrame();NativeApi.CImguiWrapper.CImGui_ImplWin32_NewFrame();break;caseGraphicsType.opengl:NativeApi.CImguiWrapper.CImGui_ImplOpenGL3_NewFrame();NativeApi.CImguiWrapper.CImGui_ImplWin32_NewFrame();break;default:thrownewException("Not support "+graphicType);}ImGui.NewFrame();}privatestaticvoidHandleIO(){//Somehow ImGui.IsKeyDown doesn't work :v//Mess with GetAsyncKeyState Insteadvarx=NativeApi.GetAsyncKeyState(Keys.Home);if(x==1||x==Int16.MinValue){ShowMenu=!ShowMenu;}InputManager.HandleInput=!ShowMenu;vario=ImGui.GetIO();io.MouseDrawCursor=ShowMenu;}privatestaticPermissionsChoosenPermissions;privatedelegateboolMatchRequirement();privatestaticDictionary<string,Action>Pages=newDictionary<string,Action>();privatestaticDictionary<Action,MatchRequirement>DebugsUI=newDictionary<Action,MatchRequirement>();privatestaticstringSelectedPage="Main Menu";privatestaticboolShowMenu=true;privatestaticvoidInitPage(){Pages.Add("UserInfo",Draw_UserInfo);Pages.Add("Debug",DrawDebugCfg);DebugsUI.Add(Draw_Beatmap_Debug,()=>{returnConfigManagement.GetValue<bool>("BeatmapDbg")&&player.Beatmap!=null;});}privatestaticvoidDrawDebugCfg(){booltoggled=ConfigManagement.GetValue<bool>("BeatmapDbg");if(ImGui.Checkbox("Beatmap Debug",reftoggled)){ConfigManagement.SetValue("BeatmapDbg",toggled);}}privateunsafestaticvoidDraw_UserInfo(){varinfo=GameBase.User;if(info!=null){try{ImGui.Text("User Info:");ImGui.Text($"Username: {info.Username}");ImGui.Text($"Id: {info.Id}");ImGui.Text($"Country Code: {info.CountryCode}");ImGui.Text($"Rank: {info.Ranks}");}catch(Exceptionex){ImGui.Text(ex.ToString());}}ImGui.Text($"Tournament: {GameBase.Tournament}");ImGui.Text($"Has login: {GameBase.HasLogin}");ImGui.Text($"Connected: {NetworkClient.Connected}");ImGui.Text($"Authenticated: {NetworkClient.Authenticated}");ImGui.Text($"Restricted: {NetworkClient.Restricted}");}privatestaticvoidDraw_MainMenu(){ImGui.Text("Wellcome Developer");ImGui.Text($"Version: {ClientVersion}");ImGui.Text($"Stream: {ClientTag}");ImGui.Text("If you are using this version, it's mean i trust you");ImGui.Text("Don't share it, my friend");ImGui.Text("Thanks ocornut for ImGui, it's save my time haha");ImGui.Text("Developer: Vynk");}privateunsafestaticvoidDraw_Beatmap_Debug(){ImGui.Begin("Beatmap Debug",ImGuiWindowFlags.AlwaysAutoResize);try{varbeatmap=Player.CurrentLevel;ImGui.Text($"Type: {Player.BeatmapInstance.GetType().Name}");ImGui.Text($"Artist: {beatmap.Artist}");ImGui.Text($"Title: {beatmap.Title}");ImGui.Text($"Creator: {beatmap.Creator}");ImGui.Text($"Version: {beatmap.Version}");ImGui.Text($"Checksum: {beatmap.BeatmapChecksum}");ImGui.Text($"Path: {beatmap.FileName}");ImGui.Text($"Objects: {beatmap.ObjectCounts}");ImGui.Text($"Time: {audioEngine.Time}");}catch(Exceptionex){ImGui.Text(ex.ToString());}ImGui.End();}privatestaticboolShownDemoWindow=false;privateunsafestaticvoidDraw(){try{if(ShowMenu){ImGui.Begin($"{ClientName}{ClientVersion} [{ClientTag}]");varkeys=Pages.Keys.ToArray();for(inti=0;i<keys.Length;i++){ImGui.SameLine();if(ImGui.Button(keys[i])){SelectedPage=keys[i];break;}}if(Pages.ContainsKey(SelectedPage))Pages[SelectedPage].Invoke();elseDraw_MainMenu();ImGui.End();}vardbgsKey=DebugsUI.Keys.ToArray();for(inti=0;i<dbgsKey.Length;i++){varkey=dbgsKey[i];if(DebugsUI[key]())key();}}catch(Exceptione){Logging.Log("Error!"+e.ToString());}}privateunsafestaticvoidRender(){ImGui.EndFrame();ImGui.Render();switch(graphicType){caseGraphicsType.d3d9:NativeApi.CImguiWrapper.CImGui_ImplDX9_RenderDrawData(ImGui.GetDrawData().NativePtr);break;caseGraphicsType.opengl:NativeApi.CImguiWrapper.CImGui_ImplOpenGL3_RenderDrawData(ImGui.GetDrawData().NativePtr);break;}}privateunsafestaticvoidImGUI_Render(IntPtrdevice,IntPtrhDc){if(!ImGuiInited){Init_Draw(device,hDc);return;}BeginDraw();HandleIO();Draw();Render();}privatestaticvoidInitStyle(){ImGui.GetStyle().WindowRounding=0.0f;ImGui.GetStyle().ChildRounding=0.0f;ImGui.GetStyle().FrameRounding=0.0f;ImGui.GetStyle().GrabRounding=0.0f;ImGui.GetStyle().PopupRounding=0.0f;ImGui.GetStyle().ScrollbarRounding=0.0f;// ImGui.PopStyleVar();}privatestaticintMouseProcHook(intcode,IntPtrwParam,IntPtrlParam){returnNativeApi.CallNextHookEx(hk_mhook,code,wParam,lParam);}privatestaticintKeyboardProcHook(intcode,IntPtrwParam,IntPtrlParam){returnNativeApi.CallNextHookEx(hk_khook,code,wParam,lParam);}privatestaticintGetMsgHook(intcode,IntPtrwParam,IntPtrlParam){if(ImGuiInited)NativeApi.CImguiWrapper.CImGui_ImplWin32_WndProcHandler(hwnd,(uint)code,wParam,lParam);returnNativeApi.CallNextHookEx(hk_msghook,code,wParam,lParam);}privatedelegateintWNDHook(intcode,IntPtrwParam,IntPtrlParam);privatestaticIntPtrhk_mhook;privatestaticIntPtrhk_khook;privatestaticIntPtrhk_msghook;privatestaticboolFallbackMode=false;privatestaticunsafevoidInstallWindowsHookEx(){if(FallbackMode){IntPtrmsHookPtr=Marshal.GetFunctionPointerForDelegate(newWNDHook(MouseProcHook));IntPtrmsKHookPtr=Marshal.GetFunctionPointerForDelegate(newWNDHook(KeyboardProcHook));IntPtrmsgHookPtr=Marshal.GetFunctionPointerForDelegate(newWNDHook(GetMsgHook));hk_khook=NativeApi.SetWindowsHookEx(2,msKHookPtr,Marshal.GetHINSTANCE(typeof(VynkL).Module),0);hk_mhook=NativeApi.SetWindowsHookEx(7,msHookPtr,Marshal.GetHINSTANCE(typeof(VynkL).Module),0);hk_msghook=NativeApi.SetWindowsHookEx(3,msgHookPtr,Marshal.GetHINSTANCE(typeof(VynkL).Module),0);}else{DefWindowProcdefWindowProc=newDefWindowProc();defWindowProc.WindowHandle=hwnd;defWindowProc.Install();Hooks.Add(defWindowProc);defWindowProc.WindowProc+=(IntPtrhWnd,uintmsg,IntPtrwParam,IntPtrlParam)=>{try{if(ImGuiInited&&ShowMenu){NativeApi.CImguiWrapper.CImGui_ImplWin32_WndProcHandler(hwnd,msg,wParam,lParam);}}catch{}returnIntPtr.Zero;};SetCursorPosNewHookCursor=newSetCursorPos();NewHookCursor.Install();Hooks.Add(NewHookCursor);NewHookCursor.SetCursorPos_Event+=(intx,inty)=>{NewHookCursor.BlockInput=ShowMenu;returnfalse;};}}
The text was updated successfully, but these errors were encountered:
ocornut
changed the title
ImGui window cannot navigate the entire screen
ImGui window not rendering in entire screen
Jan 12, 2025
Version/Branch of Dear ImGui:
Version 1.91.5
Back-ends:
imgui_impl_dx9.cpp + imgui_impl_opengl3.cpp
Compiler, OS:
Microsoft Visual C/C++ (19.36.34435) [C++] [Windows]
Full config/build information:
Compiler and linker
CC = cl
LD = link
Object files (manually concatenate)
OBJS = cimgui.obj
./imgui/imgui.obj
./imgui/imgui_draw.obj
./imgui/imgui_demo.obj
./imgui/imgui_tables.obj
./imgui/imgui_widgets.obj
./imgui/backends/imgui_impl_dx9.obj
./imgui/backends/imgui_impl_win32.obj
./imgui/backends/imgui_impl_opengl3.obj
cimgui_impl.obj
Compiler flags
CXXFLAGS = /O2 /EHsc /nologo /I./imgui /DUNICODE /D_UNICODE
LINKFLAGS = /DLL /nologo /OUT:cimgui.dll d3dcompiler.lib opengl32.lib gdi32.lib dwmapi.lib
Targets
all: cimgui.dll
Rule for building the DLL
cimgui.dll: $(OBJS)
$(LD) $ (LINKFLAGS) $(OBJS)
Rule for compiling .cpp to .obj
.cpp.obj:
$(CC) $ (CXXFLAGS) /c $< /Fo$ @
Clean
clean:$(subst /,,$ (OBJS))
del /q
Details:
I am currently working on a c# project and as you can see, the ImGui window is stuck on an invisible wall and cannot cross this limit. (the avalable area only covers a fifth of my screen, wich is problematic).
does anyone have any clue what's causing all of this ?
(Sorry, my project is written in c#, using modified cimgui [Implement backends for this])
(Sorry for can't post the real screenshot, but my issuse like this screenshot too)
Screenshots/Video:
Minimal, Complete and Verifiable Example code:
The text was updated successfully, but these errors were encountered: