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

Failed To Build On Linux With Unsafe Cast int/GLuint to void* #5

Open
TheFloatingBrain opened this issue Jun 7, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@TheFloatingBrain
Copy link

TheFloatingBrain commented Jun 7, 2022

Wanted to say this seems like a library with some potential! I wish I had could have used something like this when I was younger, there was something called SF3D but I never got far with it.

GCC-12 on Ubuntu (in podman container) errors on a couple of casts in Scene.cpp

I created this patch file in the conan recipe I wrote in order to fix this problem (lines 449 and 451:

diff --git a/Dimension3D/sources/windows/Scene.cpp b/Dimension3D/sources/windows/Scene.cpp
index 62b5499..3fa36d8 100644
--- a/Dimension3D/sources/windows/Scene.cpp
+++ b/Dimension3D/sources/windows/Scene.cpp
@@ -446,9 +446,9 @@ namespace dim
 		active = ImGui::IsWindowFocused();
 
 		ImGui::SetCursorPos(ImVec2(8.f, 27.f));
-		ImGui::Image(frame_buffer.get_texture().get_id(), ImVec2(static_cast<float>(temp.x), static_cast<float>(temp.y)), ImVec2(0.f, 1.f), ImVec2(1.f, 0.f));
+		ImGui::Image((void*) frame_buffer.get_texture().get_id(), ImVec2(static_cast<float>(temp.x), static_cast<float>(temp.y)), ImVec2(0.f, 1.f), ImVec2(1.f, 0.f));
 		ImGui::SetCursorPos(ImVec2(8.f, 27.f));
-		ImGui::Image(render_texture.getTexture().getNativeHandle(),
+		ImGui::Image((void*) render_texture.getTexture().getNativeHandle(),
 			ImVec2(static_cast<float>(render_texture.getTexture().getSize().x),
 			static_cast<float>(render_texture.getTexture().getSize().y)), ImVec2(0.f, 1.f), ImVec2(1.f, 0.f));

However it still throws a warning.

@TheFloatingBrain
Copy link
Author

Casting with

(void*)(intptr_t)

Removes the errors + warnings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants