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

Fix custom_scene_viewer for macOS #256

Merged

Conversation

srmainwaring
Copy link
Contributor

🦟 Bug fix

No issue raised but related to #185

Summary

The example custom_scene_viewer does not display a window on macOS. The example will build and run, the console will display the usage, however the GLUT window does not open.

Configuration

  • OS: macOS Catalina 10.15.7
  • Machine: Mac Pro (2019)
  • Config: ignition-rendering4

Detail

The issue was that the OpenGL context was not managed for macOS. The fix is to add the conditional compilation flags and variables used in the simple_demo and adapt them for this example. It was also necessary to move the glutInit() to
main() as it seems that this is required before the rendering engine is initialised during the scene building.

  1. Add OpenGL context settings for macOS to the DemoWindow.
  2. Move glutInit to main
  3. Add command line option to set the ogre engine.

Tests

Because of issues with a side-by-side install of ogre and ogre2, tests were limited to ogre1.9 only and ogre2 was brew unlinked before compilation of ignition-rendering.

The images show the first four scenes of the demo running on macOS.

custom_scene_view_1
custom_scene_view_2
custom_scene_view_3
custom_scene_view_4

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

@github-actions github-actions bot added the 🔮 dome Ignition Dome label Feb 24, 2021
@chapulina chapulina added the macOS macOS support label Feb 24, 2021
Copy link
Contributor

@chapulina chapulina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution, we'll be trying it out shortly. Meanwhile, do you mind signing your commit to satisfy the DCO check? See our contributing guide.

@srmainwaring
Copy link
Contributor Author

Sure - will do. Thought I'd set that up in SourceTree before committing but must have missed something. Are you ok with a force push on the PR once I get the signing in place?

@chapulina
Copy link
Contributor

Are you ok with a force push on the PR once I get the signing in place?

Sure, I think there's no way around this. Thanks!

@srmainwaring srmainwaring force-pushed the feature/ir4-custom_scene_viewer branch from cb40031 to 0f82c1f Compare February 24, 2021 23:02
@srmainwaring
Copy link
Contributor Author

Force pushed signed commit.

@ahcorde
Copy link
Contributor

ahcorde commented Feb 25, 2021

it's still not signed - DCO

@srmainwaring srmainwaring force-pushed the feature/ir4-custom_scene_viewer branch from 0f82c1f to 202315b Compare February 25, 2021 10:17
1. Add OpenGL context settings for macOS to the DemoWindow.
2. Move glutInit to main
3. Add command line option to set the ogre engine.

Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
@srmainwaring srmainwaring force-pushed the feature/ir4-custom_scene_viewer branch from 202315b to 3117c7d Compare February 25, 2021 10:28
@srmainwaring
Copy link
Contributor Author

Rebased on upstream ign-rendering4 and signed-off

Copy link
Contributor

@iche033 iche033 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the patch. Changes look good and consistent with other example code.

Just one minor coding style suggestion.

examples/custom_scene_viewer/ManualSceneDemo.cc Outdated Show resolved Hide resolved
1. Use camel case for variables.

Signed-off-by: Rhys Mainwaring <rhys.mainwaring@me.com>
@iche033
Copy link
Contributor

iche033 commented Feb 27, 2021

@osrf-jenkins run tests please

@iche033 iche033 merged commit 6d93957 into gazebosim:ign-rendering4 Mar 1, 2021
@srmainwaring srmainwaring deleted the feature/ir4-custom_scene_viewer branch March 5, 2021 11:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔮 dome Ignition Dome macOS macOS support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants