Page 1 of 1

opengl for OSX broken in 2.2 branch

Posted: Thu Aug 08, 2019 3:32 pm
by bayoubengal
the opengl module for OSX is broken looks like "createWindow" and "newWindow" return a differnt class now.

What do I need to do to restore opengl functionality?

Re: opengl for OSX broken in 2.2 branch

Posted: Thu Aug 08, 2019 6:59 pm
by dark_sylinc

Functionality that used to live in RenderWindow (2.1) got split into simply 'Window' and a special TextureGpu (GL3PlusTextureGpuWindow).

'Window' handles most of the windowing and GL context stuff, and it is most likely to resemble a lot to the old RenderWindow code.
But when it comes to binding the window as a RenderTarget (e.g. for rendering into it), you use the special GL3PlusTextureGpuWindow.

PRs to restore OSX GL are welcomed.

If you need example references, compare:

1. GL3PlusTextureGpuWindow. Should be platform agnostic and hopefully work out of the box on OSX as well. It is created via GL3PlusTextureGpuManager::createTextureGpuWindow.

2. OgreGLXWindow.cpp and OgreGLXWindow.h are still there, but with modifications (it now derives from Window instead of RenderWindow, also setups GL3PlusTextureGpuWindow).

3. OgreWin32Window.cpp and OgreWin32Window.h: Same remarks as OgreGLXWindow

4. GLXGLSupport::newWindow and Win32GLSupport::newWindow. They don't do much fancy. They're not too different from their 2.1 counterparts. Just different argument and return class.

Note that 2.1 had a tendency to create the window and initialize it at the same time, whereas in 2.2 this was split into creation (which happens in GLXGLSupport::newWindow and co) and initialization (which happens in Window::_initialize).

Overall it boils down to mostly moving code around, renaming a few classes so that they use Window instead of RenderWindow, and preparing the GL3PlusTextureGpuWindow. If you diff old and new OgreGLXWindow.cpp with a graphical tool, you will find a lot of similarities.

Btw RenderWindow is not used anymore. It should become dead code and eventually be removed. So if you see 'what should I do this with RenderWindow?' you likely need to replace it with a Window, or with window->getTexture().

If you have doxygen, build the docs and read Ogre2.2.Changes (build from in Docs/src/manual) to understand what changed between 2.1 and 2.2


Re: opengl for OSX broken in 2.2 branch

Posted: Thu Aug 08, 2019 8:04 pm
by bayoubengal