Re: [osg-users] Getting window id for all platforms

2011-01-06 Thread Robert Osfield
Hi Anders,

I'm afraid the window handles differ in type across platforms so it's
not possible to directly have a single cross platform handle.

There are methods in each the GraphicsWindow subclasses for getting
the platform specific handles, but you'll need to cast and use the
appropriate types/methods for each of these.

Robert.

On Tue, Jan 4, 2011 at 3:30 PM, Anders Backman ande...@cs.umu.se wrote:
 Hi all.
 I would like to get the window reference for all platforms using
 osgViewer::Viewer.
 I found the thread:
 http://www.mail-archive.com/osg-users@openscenegraph.net/msg12957.html
 Where I used this code for win32:
 osgViewer::GraphicsWindowWin32* gw =
     dynamic_castosgViewer::GraphicsWindowWin32* (
     application-getViewer()-getCamera()-getGraphicsContext());

 HWND hWnd = gw-getHWND();

 But I cant find a way to get that under X11, (MacOS, Cocoo or whatever).
 Is there a portable way of getting this reference?
 /A


 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Getting window id for all platforms

2011-01-06 Thread Anders Backman
Sure, which is what I did for Win32.
But to what should I cast it in other cases? X11? There is only two relevant
classes there: GraphicsWindow and GraphicsWindowWin32...
I would have expected something like GraphicsWindowX11?

/A

On Thu, Jan 6, 2011 at 12:24 PM, Robert Osfield robert.osfi...@gmail.comwrote:

 Hi Anders,

 I'm afraid the window handles differ in type across platforms so it's
 not possible to directly have a single cross platform handle.

 There are methods in each the GraphicsWindow subclasses for getting
 the platform specific handles, but you'll need to cast and use the
 appropriate types/methods for each of these.

 Robert.

 On Tue, Jan 4, 2011 at 3:30 PM, Anders Backman ande...@cs.umu.se wrote:
  Hi all.
  I would like to get the window reference for all platforms using
  osgViewer::Viewer.
  I found the thread:
  http://www.mail-archive.com/osg-users@openscenegraph.net/msg12957.html
  Where I used this code for win32:
  osgViewer::GraphicsWindowWin32* gw =
  dynamic_castosgViewer::GraphicsWindowWin32* (
  application-getViewer()-getCamera()-getGraphicsContext());
 
  HWND hWnd = gw-getHWND();
 
  But I cant find a way to get that under X11, (MacOS, Cocoo or whatever).
  Is there a portable way of getting this reference?
  /A
 
 
  ___
  osg-users mailing list
  osg-users@lists.openscenegraph.org
 
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
 
 
 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




--
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Getting window id for all platforms

2011-01-06 Thread Jean-Sébastien Guay

Hi Anders,


Sure, which is what I did for Win32.
But to what should I cast it in other cases? X11? There is only two
relevant classes there: GraphicsWindow and GraphicsWindowWin32...
I would have expected something like GraphicsWindowX11?


If you are looking at the include dir of an installed OSG, you will only 
have the header(s) relevant to the platform it's installed on. In the 
OSG source tree, in the include/osgViewer directory, you'll see 
GraphicsWindowWin32, GraphicsWindowX11, GraphicsWindowCarbon, 
GraphicsWindowCocoa, etc.


You'll have to guard inclusion of these headers to make sure you only 
include them on the right platform.


Hope this helps,

J-S
--
__
Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Getting window id for all platforms

2011-01-06 Thread Anders Backman
Ah, ok then.
I was not browsing the source, just the built/installed stuff, on a win32
machine, which meant I only had the win32 version.

Ok then. Thanks.

/A

On Thu, Jan 6, 2011 at 10:30 PM, Jean-Sébastien Guay 
jean-sebastien.g...@cm-labs.com wrote:

 Hi Anders,


  Sure, which is what I did for Win32.
 But to what should I cast it in other cases? X11? There is only two
 relevant classes there: GraphicsWindow and GraphicsWindowWin32...
 I would have expected something like GraphicsWindowX11?


 If you are looking at the include dir of an installed OSG, you will only
 have the header(s) relevant to the platform it's installed on. In the OSG
 source tree, in the include/osgViewer directory, you'll see
 GraphicsWindowWin32, GraphicsWindowX11, GraphicsWindowCarbon,
 GraphicsWindowCocoa, etc.

 You'll have to guard inclusion of these headers to make sure you only
 include them on the right platform.

 Hope this helps,

 J-S
 --
 __
 Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com
   http://www.cm-labs.com/
http://whitestar02.webhop.org/

 ___
 osg-users mailing list
 osg-users@lists.openscenegraph.org
 http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Getting window id for all platforms

2011-01-04 Thread Anders Backman
Hi all.

I would like to get the window reference for all platforms using
osgViewer::Viewer.

I found the thread:

http://www.mail-archive.com/osg-users@openscenegraph.net/msg12957.html

Where I used this code for win32:

http://www.mail-archive.com/osg-users@openscenegraph.net/msg12957.html
osgViewer::GraphicsWindowWin32* gw =
dynamic_castosgViewer::GraphicsWindowWin32* (
application-getViewer()-getCamera()-getGraphicsContext());


HWND hWnd = gw-getHWND();


But I cant find a way to get that under X11, (MacOS, Cocoo or whatever).
Is there a portable way of getting this reference?

/A
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org