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 

Undocking WIN32 causes problems


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


Joined: 19 Jan 2018
Posts: 14

PostPosted: Sat Mar 10, 2018 4:16 am    Post subject:
Undocking WIN32 causes problems
Reply with quote

Hello,

I am running my OSG scene in a WIN32 application. I hooked it up to the window using the following code and it works great. When I resize the window the scene resizes perfectly. However, when I undock the window from the parent form the OSG scenes goes black and I lose all further contact. Has anybody had any experience with OSG running in a windows application?

RECT rect;
HWND hHwnd = (HWND)handle;

GetWindowRect(hHwnd, &rect);

osg::ref_ptr<osg::Referenced> windata = new osgViewer::GraphicsWindowWin32::WindowData(hHwnd);
osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits;

traits->x = 0;
traits->y = 0;
traits->width = rect.right - rect.left;
traits->height = rect.bottom - rect.top;
traits->windowDecoration = false;
traits->doubleBuffer = true;
traits->sharedContext = 0;
traits->inheritedWindowData = windata;

Any hints or examples would be most welcome!

Many thanks for your help!!

Adrian
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 Problems porting from osg-3.4.0 to os... hvarma General 5 Wed Sep 12, 2018 3:29 pm View latest post
No new posts problems with osg-3.4.0 port to osg-3... Herman Varma General 4 Wed Sep 12, 2018 2:26 pm View latest post
No new posts Drawable - recent commit causing prob... gwaldron General 3 Thu Aug 30, 2018 12:19 pm View latest post
No new posts osglight demo problems with Intel gra... eventhorizon5 General 2 Mon Jul 09, 2018 8:52 pm View latest post
No new posts Problems with MRT romulogcerqueira General 9 Sat May 12, 2018 4:46 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