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 

Reapply GL context


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
arennuit
User


Joined: 06 Dec 2013
Posts: 45

PostPosted: Wed Aug 23, 2017 8:57 am    Post subject:
Reapply GL context
Reply with quote

Hello OSG forum,

I use a windowing system that already makes use of GL. I have the feeling that this windowing system breaks my OSG managed GL context.

Is there a way I can save / reapply my OSG GL context before calling frame() (so as to make sure my rendering is not disturbed by my windowing system).

Thank you!

Kind regards,

Antoine
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 11154

PostPosted: Wed Aug 23, 2017 9:20 am    Post subject:
Reapply GL context
Reply with quote

Hi Antoine,

On 23 August 2017 at 09:57, Antoine Rennuit < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
I use a windowing system that already makes use of GL. I have the feeling that this windowing system breaks my OSG managed GL context.

Is there a way I can save / reapply my OSG GL context before calling frame() (so as to make sure my rendering is not disturbed by my windowing system).


Integrating things the way you are wanting to is not directly supported by the OSG, it's possible to do but awkward, you need to know more about the internals of the OSG/OpenGL and the 3rd party GL code to be able to do it.



OpenGL has a glPushAttrib/glPopAttrib feature that can be used to save and restore state.


The OSG also has various osg::State::haveApplied*() methods to telling the OSG state tracking system that a particular element of state has changed.


I don't personally have expertise on the Qt side so really can't help you with specifics, if others in the community have done what you are attempting then they will be the most effective at helping you.  The best I can do is provide some high level pointers about what is available on the OSG side.


Robert.

 

------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
arennuit
User


Joined: 06 Dec 2013
Posts: 45

PostPosted: Wed Aug 23, 2017 10:33 am    Post subject:
Reply with quote

Robert,

Thanks a lot for your answer, it already helps understanding things.

One option I am considering is having OSG render from a GL context of its own. I then read about GraphicsContext (from which my window inherits) in the beginners guide, which is associated to a camera and view. Though I guess this osg::GraphicsContext does not switch the GL context on the GPU.

So do you know if there is an OSG way for switching GL contexts on the GPU?

Regards,

Antoine.
Back to top
View user's profile Send private message
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 Specifying the GL context version to ... Sandro Mani General 17 Mon Aug 21, 2017 11:43 am View latest post
No new posts Crash with VBO and shared context jumaroch General 0 Tue Jul 25, 2017 1:24 pm View latest post
No new posts Crash with VBO and shared context jumaroch General 10 Tue Jul 25, 2017 1:23 pm View latest post
No new posts OSG is unable to create 3.3 core prof... ne0ndrag0n General 5 Sat Jul 22, 2017 4:21 pm View latest post
No new posts Change Graphic Context Runtimely tianzjyh General 0 Mon Nov 21, 2016 10:09 am 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