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

Set resizable window on Windows #1070

Closed
dariosortino opened this issue May 3, 2023 · 11 comments · Fixed by #1071
Closed

Set resizable window on Windows #1070

dariosortino opened this issue May 3, 2023 · 11 comments · Fixed by #1071

Comments

@dariosortino
Copy link

dariosortino commented May 3, 2023

At the moment is impossible to resize the visualizer window in Windows OS.

With @S-Dafarra in https://github.com/robotology/human-dynamics-estimation/pull/341/files , we added the possibility to set the height and width of the window in a configuration file as a workaround to this, but it's not convenient if we keep switching between different screens with different resolutions.

cc @traversaro

@S-Dafarra
Copy link
Contributor

I have tried adding setResizable(true) but as soon as the visualizer starts, the window shrinks and the visualization is messed up.

Investigating

@traversaro
Copy link
Member

I have tried adding setResizable(true) but as soon as the visualizer starts, the window shrinks and the visualization is messed up.

Investigating

For testing you could try also to temporary revert #976 (by commenting the line https://github.com/robotology/idyntree/blob/v8.1.0/src/visualization/src/Visualizer.cpp#L283) to see if without using SDL the resize on Windows works. If that works, we can think about exposing that so that we can opt-out of using SDL on Windows, as anyhow the problem reported in #975 is not a problem if HumanStateVisualizer is a process just devoted to visualization .

@S-Dafarra
Copy link
Contributor

S-Dafarra commented May 3, 2023

I tried it, but it is still not usable. I think it may be a bug on the Windows implementation of irrlicht. I also tried following a bit https://irrlicht.sourceforge.io/forum/viewtopic.php?t=43316&sid=34c5d329ed5118c383d18231a046b4e9, but I had no luck. I am not able to change the size of the window from code.

@S-Dafarra
Copy link
Contributor

S-Dafarra commented May 3, 2023

I managed to make it working. Instead of removing that line, I had to change it to

irrDevParams.DeviceType = irr::EIDT_WIN32;

@S-Dafarra
Copy link
Contributor

I tried it, but it is still not usable. I think it may be a bug on the Windows implementation of irrlicht. I also tried following a bit https://irrlicht.sourceforge.io/forum/viewtopic.php?t=43316&sid=34c5d329ed5118c383d18231a046b4e9, but I had no luck. I am not able to change the size of the window from code.

Actually, I did a mistake before, and I commented out the wrong lines. Indeed, the suggestion of @traversaro was correct. Now we can decide if we want to resize or close the window 😂

@traversaro
Copy link
Member

Cool! While we thing how to do this properly @dariosortino I think you can do the local modification suggested in #1070 (comment) and tested by @S-Dafarra in your system/the system used for the demo, so that for future them you can already resize the window, right?

@S-Dafarra
Copy link
Contributor

While we thing how to do this properly

What about creating a window on our own and have irrlicht printing on it? In this way we might be able to deal with the closure more easily. I have been using glfw in the past and it might also be a quite portable solution. @traversaro what do you think?

@S-Dafarra
Copy link
Contributor

While we thing how to do this properly

What about creating a window on our own and have irrlicht printing on it? In this way we might be able to deal with the closure more easily. I have been using glfw in the past and it might also be a quite portable solution. @traversaro what do you think?

I have quickly tried, but no inputs are received by the engine. I probably need to pass custom events via postEventFromUser

@S-Dafarra
Copy link
Contributor

I have started having some results with the custom window, without the mouse inputs. Here the commit https://github.com/S-Dafarra/idyntree/tree/test_visualization

Funny story. If I run the test where I use two visualizer, the entire graphical system of my PC crashes 😅

@S-Dafarra
Copy link
Contributor

S-Dafarra commented May 4, 2023

Funny story. If I run the test where I use two visualizer, the entire graphical system of my PC crashes

Actually, I was testing an old version in my PC cause I forgot to install 😓 It seems to be working now after removing this line https://github.com/S-Dafarra/idyntree/blob/212fdb017a6922404b7af3362c1e81f375530ae1/src/visualization/src/Visualizer.cpp#L830

@S-Dafarra
Copy link
Contributor

With S-Dafarra@2ed1e97 I managed to have mouse inputs working. Hence, I should have recovered all the features. I need to test it on Windows

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 a pull request may close this issue.

3 participants