Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple fixes #56

Closed
wants to merge 6 commits into from
Closed

Simple fixes #56

wants to merge 6 commits into from

Conversation

pthom
Copy link

@pthom pthom commented Apr 18, 2024

Hello,

In this pull request, I provide some simple fixes that I added when working on netImgui.

The commit messages should be sufficient to explain the content:

ea331b8 Add missing includes

5fa7511 Server init: correct fail message condition
There was a probable typo in the code

02a7d8a Rework ImTextureID casts: added ToImTextureID helper
ImTextureID could be anything (void *, uint64_t, uint_16t, GLuint, etc.)
so that using reinterpret_cast / static_cast can generate warnings or errors in some compilers,
depending on what the actual type of ImTextureID is. So, we resort to a C style double cast.

2279603 Use ImWChar for character (handle cases where we use ImWchar32)
(the compilation failed when using ImWchar32)

fa62011 NetImGui_Api / NewFrame: if (client.mbIsDrawing) return false
When a client wants to reconnect to the server, we can get to a situation where mbIsDrawing is true on the first frame. However, it will work on subsequent frames.

7c4fd3b Client::Uninitialize(): set mpBGContext->IO.BackendRendererUserData = nullptr before destroy
Otherwise we may end up in situations where ImGui::DestroyContext fails because it is not null.
This pointer was set to an external content, so it is safe to do so, and should not leak

ImTextureID could be anything (void *, uint64_t, uint_16t, GLuint, etc.)
so that using reinterpret_cast / static_cast can generate warnings or errors in some compilers,
depending on what the actual type of ImTextureID is. So, we resort to a C style double cast.
When a client wants to reconnect to the server, we can get to a situation where mbIsDrawing is true on the first frame. However, it will work on subsequent frames.
… nullptr before destroy

Otherwise we may end up in situations where ImGui::DestroyContext fails because it is not null.
This pointer was set to an external content, so it is safe to do so, and should not leak.
@sammyfreg
Copy link
Owner

sammyfreg commented Apr 19, 2024 via email

@pthom pthom mentioned this pull request Apr 19, 2024
sammyfreg added a commit that referenced this pull request May 26, 2024
Small fixes based on PR #56 by GitHub user @pthom
sammyfreg added a commit that referenced this pull request May 27, 2024
* Added 'TakeOver' Option

NetImguiServerApp can now forcefully take over a connection to a client already connected to another server. A button with 'TakeOver' appear in the Client List letting the user connect despite an active connection.

* Small fixes

Small fixes based on PR #56 by GitHub user @pthom

* Updated to Dear ImGui 1.90.6

- Server updated to latest Dear Imgui
- Added compatibility tests up to that version

* API version update for release
@sammyfreg
Copy link
Owner

I ended up applying some of your fixes in 637411b

@sammyfreg sammyfreg closed this May 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants