OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Displaying a scene in the background ofa QGraphi


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
Fabien Lavignotte
Guest





PostPosted: Wed Nov 05, 2008 4:27 pm    Post subject:
Displaying a scene in the background ofa QGraphi
Reply with quote

Hi,
I have tested the integration between Qt GraphicsView and OSG too.
To have better results, don't use drawBackground() to do OSG drawing but
overload the paint event of QGraphicsView, somthing like that :

void MyGraphicsView::paintEvent( QPaintEvent* event )
{
QGLWidget* widget = dynamic_cast<QGLWidget*>( viewport() );
if (widget)
{
widget->makeCurrent();
getCanvas()->frame();
}
QGraphicsView::paintEvent( event );
}

Using drawBackground() is a bad idea because Qt has already initialized
some OpenGL state for its needs.
I have much better result this way. I still have some problems when
using osgEphemeris. Mixing Qt and OSG rendering in the same OpenGL
context does not seems very robust.
Maybe it is needed to "clear" OSG state before calling
QGraphicsView::paintEvent() but i stop my investigations there.
Hope that helps

Fabien

-----Original Message-----
From:
[mailto:] On Behalf Of Yvon
Halbwachs
Sent: mercredi 5 novembre 2008 15:49
To:
Subject: Re: Displaying a scene in the background ofa
QGraphicsView

Hi everybody,

I managed to use osg in a Qt QGraphicsView with the information that
Eric Zeremba and Rene Molenaar posted some weeks ago. I still have some
troubles though... Things work fine when I display the "cow.osg" scene
from the OpenSceneGraph example files, but nothing is displayed when I
use "cessna.osg". The only way to display it is to enable display lists
(it is set to false by default).

Anybody has a clue about what's going on?

Yvon



g

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________


------------------
Post generated by Mail2Forum
Back to top
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing objects with shared GL state... AnyOldName3 General 0 Wed Mar 20, 2019 5:05 pm View latest post
No new posts Deep cloning an active root scene node Robert Lockyer General 7 Thu Feb 28, 2019 5:52 pm View latest post
No new posts Happy New Year to all OSG Users Chris Hanson General 0 Mon Jan 07, 2019 10:17 am View latest post
No new posts osg-users Digest, Vol 138, Issue 27 Zachary1234 General 0 Tue Jan 01, 2019 1:16 am View latest post
No new posts osg-users Digest, Vol 137, Issue 14 poweruserm@live.com.au General 0 Fri Nov 16, 2018 11:16 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP