I will look in to this. I was unaware that would allow me to do what I wanted. 
Aside from the GraphicsWindowX11, I was able to do what I want another way too. 
We were already subclassing osgViewer so I added a custom renderingTraversals 
function. I copied the original one and then changed the SwapBuffersOperation 
to a custom one that I subclassed. This is a pain though due to the length of 
renderingTraversals and potential of updates in the future. I was going to look 
in to doing a GraphicsContext->getOperationsQueue and then rebuilding it with a 
the custom SwapBuffersOperation, but the setSwapCallback() sounds like a better 
idea.

-----Original Message-----
From: osg-users [mailto:[email protected]] On Behalf 
Of Voerman, L.
Sent: Thursday, May 28, 2015 4:05 AM
To: OpenSceneGraph Users
Subject: Re: [osg-users] Issue Subclassing GraphicsWindowX11

Hi Karl,
Did you find the GraphicsContext->setSwapCallback() call? It seems to me you 
are taking a very difficult route to get a custom swapBuffersImplementation.
Regards, Laurens.

On Thu, May 28, 2015 at 9:56 AM, Robert Osfield <[email protected]> 
wrote:


        Hi Karl,
        
        
        I haven't heard of this specific problem before, but then most users 
won't be subclassing from GraphicsWindowX11.  In principle I can't see any 
reason why it wouldn't work.  Without code in front of me that fails to compile 
I can only provides guesses as to what is amiss - my best guess is that either 
a X11 header needs to be added, or the ordering needs to be adjusted.
        
        
        I can't be any more specific without seeing the problem first hand and 
attempting to resolve it.
        

        Robert.
        


        On 27 May 2015 at 15:32, Cary, Karl A. <[email protected]> wrote:
        

                I need to subclass the GraphicsWindowX11 class in order to 
provide a custom swapBuffersImplementation. However, when I do this I then get 
a really random error in the middle of one of my enumerations (expected 
identifier before numeric constant). It happens when I include 
osgViewer/api/X11/GraphicsWindowX11, which I have to include in order to 
subclass GraphicsWindowX11. If not I am told 'expected class name before {'. As 
for the enumeration, it happens on the definition of an enumeration value 
called 'None' (NOTE: the value is called None, not the enumeration). It is a 
3rd party header/library so it cannot be changed. Any idea what is going on? Or 
is there a different way I need to be including/subclassing/declaring 
GraphicsWindowX11? Thank you.
                
                #include <osgViewer/GraphicsWindow>
                #include <osgViewer/api/X11/GraphicsWindowX11>
                
                class MyWindow : public osgViewer::GraphicsWindowX11
                {
                        public:
                                MyWindow(osg::GraphicsContext::Traits* traits):
                                        osgViewer::GraphicsWindowX11(traits) {}
                
                                virtual void swapBuffersImplementation();
                };
                
                
                _______________________________________________
                osg-users mailing list
                [email protected]
                
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
                
                



        _______________________________________________
        osg-users mailing list
        [email protected]
        
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
        
        


Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to