if application xcode doesn't build, then remove all files *.cpp and *.h
and add just application.cpp and application.h to the project. (sorry, may i
forget to remove them)
2008/2/11, Adrian Egli OpenSceneGraph (3D) <[EMAIL PROTECTED]>:
>
> Hi Stephan,
>
> i played arround friday with a small safari osg plugin and did some small
> changes in the graphics window files for carbon. may you check out this two
> files and extract my safari_osg.tar.gz file. then you should be able to
> build them with xcode. first application, second the plugin, and third have
> a look into the test.sh and
> the *.html files. it sould work.
>
> there is no keyboard, nor mouse event. but if you right-click onto the
> menu bar of safari (links) or into the html page with the mouse, a context
> menu apprears, then press 'w' or 's' and you see that the events are
> transfert to the plugin, strange, or is something really wrong with safari
> or my plugin or carbon or .. . .
>
> /adegli
>
>
>
> 2008/2/8, Stephan Maximilian Huber <[EMAIL PROTECTED]>:
> >
> > Hi Adrian,
> >
> > Adrian Egli OpenSceneGraph (3D) schrieb:
> >
> > > may i do something wrong, or the osgViewer for Carbon is not right, i
> > don't
> > > know. The result should looking like "Bild 3". the "Bild 1" and "Bild
> > 2" are
> > > wrong, or current state of the integration. (Bild 1 : osg default
> > when
> > > window not moved, Bild 2 after bild moved)
> > >
> > >
> > I am not sure if your usage-scenario is currently doable with
> > GraphicsWindowCarbon. You want to attach a HIView (or what it is called
> > in Carbon) , which is part of a window to the osgViewer::Viewer.
> > GraphicWindowCarbon owns whole windows, it takes all the place, it eats
> > all the events, so other ui-items get lost. It is not designed to handle
> > only a view.
> >
> > The current implementation of GraphicsWindowCarbon does not process any
> > events, if it gets a "foreign" window. If you want to install the
> > eventhandlers, with a foreign window, set
> >
> > m_windowData->setInstallEventHandler(true);
> >
> > This may not work for your settings, because GraphicsWindowCarbon
> > installs several event handlers to catch Application-Quit etc.
> >
> > Perhaps it is the best way to implement your own native
> > GraphicsContext-implementation for the plugin-usage or use a
> > GraphicsWindowEmbedded and do the handling of the AGLContext yourself.
> >
> >
> > Hope that helps,
> >
> > Stephan
> >
> > (P.S. I am attaching a working example using an external window with
> > GraphicsWindowCarbon)
> >
> > //
> > // main.c
> > // cefixTemplate
> > //
> > // Created by Stephan Huber on 26.11.06.
> > // Copyright __MyCompanyName__ 2006. All rights reserved.
> > //
> >
> >
> > #include <osgViewer/api/Carbon/GraphicsWindowCarbon>
> > #include <osgViewer/Viewer>
> > #include <osg/ShapeDrawable>
> >
> > int main(int argc, char* argv[])
> > {
> >
> > // create the window:
> >
> > Rect titleRect = {100,100, 600, 800};
> > OSStatus err = 0;
> > WindowRef windowPtr;
> > WindowAttributes attr = (kWindowStandardDocumentAttributes |
> > kWindowStandardHandlerAttribute) & ~kWindowResizableAttribute;
> > err = CreateNewWindow(kDocumentWindowClass, attr, &titleRect,
> > &windowPtr);
> >
> >
> >
> >
> > osg::ref_ptr<osg::GraphicsContext::Traits> traits = new
> > osg::GraphicsContext::Traits;
> >
> > // Init the Windata Variable that holds the handle for the
> > Window to display OSG in.
> > osg::ref_ptr<osgViewer::GraphicsWindowCarbon::WindowData>
> > m_windowData = new osgViewer::GraphicsWindowCarbon::WindowData(windowPtr);
> > m_windowData->setInstallEventHandler(true);
> >
> > // Setup the traits parameters
> >
> > traits->x = titleRect.left;
> > traits->y = titleRect.top;
> > traits->width = abs(titleRect.right - titleRect.left);
> > traits->height = abs(titleRect.bottom - titleRect.top);
> > osg::notify(osg::ALWAYS) << "SIZE=" << traits->width << " x " <<
> > traits->height << std::endl;
> >
> > traits->windowDecoration = false;
> > traits->doubleBuffer = true;
> > traits->sharedContext = NULL;
> > traits->setInheritedWindowPixelFormat = false;//true;
> > traits->inheritedWindowData = m_windowData.get();
> >
> > // Create the Graphics Context
> > osg::GraphicsContext* gc =
> > osg::GraphicsContext::createGraphicsContext(traits.get());
> >
> >
> >
> > // Init a new Camera (Master for this View)
> > osg::Camera* camera = new osg::Camera;
> >
> > // Assign Graphics Context to the Camera
> > camera->setGraphicsContext(gc);
> >
> > // Set the viewport for the
> > Camera
> > camera->setViewport(new osg::Viewport(0,0, traits->width,
> > traits->height));
> >
> > // Add the Camera to the Viewer
> > osg::ref_ptr<osgViewer::Viewer> m_osg_simple_viewer = new
> > osgViewer::Viewer();
> > m_osg_simple_viewer->addSlave(camera);
> > m_osg_simple_viewer->setCamera(camera);
> >
> > osg::Group* g = new osg::Group();
> > osg::Geode* geode = new osg::Geode();
> > geode->addDrawable(new osg::ShapeDrawable(new osg::Box()));
> > g->addChild(geode);
> > m_osg_simple_viewer->setSceneData(geode);
> >
> > m_osg_simple_viewer->realize();
> >
> > m_osg_simple_viewer->run();
> >
> >
> > return 0;
> > }
> >
> >
> >
> > _______________________________________________
> > osg-users mailing list
> > [email protected]
> >
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> >
>
>
> --
> ********************************************
> Adrian Egli
>
--
********************************************
Adrian Egli
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org