Skip to content

Commit

Permalink
Fix crash caused by Visualizer::close on Windows by switching used Ir…
Browse files Browse the repository at this point in the history
…rlicht Device on Windows to `irr::EIDT_SDL` (#976)

* Fix crash caused by Visualizer::close on Windows

* Update CHANGELOG.md
  • Loading branch information
traversaro authored Feb 23, 2022
1 parent 97aba0c commit 4aabb85
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased Major]

## [5.0.1] - 2022-02-23

### Fixed

- Avoid to use iDynTree material (for example the one specified in URDF) when `.obj` meshes are loaded in the Irrlicht visualizer (https://github.com/robotology/idyntree/pull/974).
- Fix crash on `Visualizer::close` on Windows (https://github.com/robotology/idyntree/pull/976). The fix works only if the used Irrlicht is compiled with SDL support.

## [5.0.0] - 2022-02-08

Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

cmake_minimum_required(VERSION 3.16)

project(iDynTree VERSION 5.0.0
project(iDynTree VERSION 5.0.1
LANGUAGES C CXX)

# Disable in source build, unless Eclipse is used
Expand Down
6 changes: 6 additions & 0 deletions src/visualization/src/Visualizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,12 @@ bool Visualizer::init(const VisualizerOptions &visualizerOptions)

irr::SIrrlichtCreationParameters irrDevParams;

// If we are on Windows and the SDL backend of Irrlicht is available,
// let's use it to avoid spurios WM_QUIT signal being raised in the
// close() method, see https://github.com/robotology/idyntree/issues/975
#if defined(_WIN32) && defined(_IRR_COMPILE_WITH_SDL_DEVICE_)
irrDevParams.DeviceType = irr::EIDT_SDL;
#endif
irrDevParams.DriverType = irr::video::EDT_OPENGL;
irrDevParams.WindowSize = irr::core::dimension2d<irr::u32>(visualizerOptions.winWidth, visualizerOptions.winHeight);
irrDevParams.WithAlphaChannel = true;
Expand Down

0 comments on commit 4aabb85

Please sign in to comment.