Skip to content

[WIP] Editor: Update osgQt in extern#2786

Closed
unelsson wants to merge 1 commit intoOpenMW:masterfrom
unelsson:osgqt_inseparatedir
Closed

[WIP] Editor: Update osgQt in extern#2786
unelsson wants to merge 1 commit intoOpenMW:masterfrom
unelsson:osgqt_inseparatedir

Conversation

@unelsson
Copy link
Copy Markdown
Collaborator

Very heavily WIP, but a PR for commenting and pointing out stuff early. Idea is to update osgQt in extern. It's used by the OpenMW-CS scene view. I understood it generated some errors, and it's probably a reason for a crash when exiting OpenMW-CS compiled with Qt5.

The PR is currently broken (probably should use osgQOpenGLWidget instead of Window), but it does compile. There might be additional unused clutter here too. I haven't really worked with CMakeLists or Qt MOC before.

What's done:

@akortunov
Copy link
Copy Markdown
Contributor

Are there plans to continue development of this PR?

@unelsson
Copy link
Copy Markdown
Collaborator Author

Are there plans to continue development of this PR?
Plans, yes. But it's not so straightforward.

This ran into an issue with newer osgQt not having osgViewer::CompositeViewer. I wrote an issue about this to openscenegraph/osgQt#37 .

What I understand, this would either require:

  1. implementing osgViewer::CompositeViewer to newer osgQt
    or 2) changing OpenMW-CS to use osgViewer::Viewer

I don't really know what way to go with this. Ideas?

@psi29a
Copy link
Copy Markdown
Member

psi29a commented Jun 23, 2020

@unelsson not sure if you're still on this but... Perhaps a read here would help?
http://www.openscenegraph.org/index.php/documentation/guides/programming-guides/93-viewer-vs-compositeviewer

Basically... we need compositeviewer (a list of views) since OpenMW-CS can have multiple views (terrain, objects, etc.). The 'viewer' was meant purely for one camera (or more slave cameras that you switch between), while the compositeviewer was to allow for multiple viewers to be shown at once.

The examples do indeed only show osgViewer::Viewer so it looks like we'll have to maintain our own osgViewer::CompositeViewer to have a list of osgViewer::Viewer instances in OpenMW-CS.

@psi29a
Copy link
Copy Markdown
Member

psi29a commented Jun 23, 2020

Looks like we're not the only ones to come across this problem:
https://github.com/rdiankov/openrave/pull/583/files

@psi29a
Copy link
Copy Markdown
Member

psi29a commented Jun 23, 2020

It seems that dropped osgQt and rolled their own using QOSGViewerWidget

Could be worth looking into.

@psi29a
Copy link
Copy Markdown
Member

psi29a commented Jun 23, 2020

- class ViewerWidget : public QWidget, public osgViewer::CompositeViewer
+ class QOSGViewerWidget : public QOpenGLWidget

@unelsson
Copy link
Copy Markdown
Collaborator Author

I've been looking at this a bit. Seems that the old GraphicsWindowQt created a GLWidget
_widget = new GLWidget( traits2qglFormat( _traits.get() ), parent, shareWidget, flags ); which is class GLWidget : public QGLWidget.

It might be what OpenMW needs. QGLWidget is in QT5: "QGLWidget provides functionality for displaying OpenGL graphics integrated into a Qt application." Anyway, the process isn't just about updating to the new osgQt, but rather dropping that and making something that works. Gotta look into this later!

@AnyOldName3
Copy link
Copy Markdown
Member

QGLWidget was deprecated in favour of QOpenGLWidget with the 5.0 release. The whole point of this exercise is to migrate from the deprecated Qt4 approach to the non-deprecated Qt5 approach.

@psi29a
Copy link
Copy Markdown
Member

psi29a commented Oct 13, 2020

Closing this for now since work has stalled. Feel free to continue your work here: https://gitlab.com/OpenMW/openmw

@psi29a psi29a closed this Oct 13, 2020
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.

4 participants