Fascinating work, Alistair. We've done similar hacks on em,bedded devices with EGL where we created a context in EGL ourselves and used GraphicsWindowEmbedded (not with Qt necessarily though).
On Thu, Jul 10, 2014 at 7:16 AM, Alistair Baxter <alist...@mve.com> wrote: > We have been developing a cross-platform tablet app using Qt Quick > integrated with OpenSceneGraph in a similar way to that described here: > http://qt-project.org/forums/viewthread/31277 > > > > Qt 5 is available set up to use both desktop OpenGL and Google’s ANGLE > wrapper for Direct3D ( https://code.google.com/p/angleproject/ ), so I > was interested to see if I could make OSG, and osgEarth, work in this > environment, since I had seen ANGLE mentioned several times on this mailing > list, but no evidence of any development with it. Qt official advice > recommends ANGLE for the following situations: > > > > · You need OpenGL ES features, but not full OpenGL > > · You have a heterogeneous user base with different Windows > versions & graphics cards > > · You do not want your user to have to install a recent graphics > card driver > > · Your application needs to run over Windows Remote Desktop > Protocol > > > > And in addition, it forms a step towards getting OSG going on Windows RT > 8.1 and Windows Phone 8.1. > > > > > > I am pleased to report that I have both packages working with ANGLE now to > my satisfaction, and have had it running for a few weeks now, with shaders > and other rendering code identical between desktop Windows, iOS and > Android. I outline here the steps I had to take so that others may follow > my example, or that the build system issues I faced might be sorted out. > > > > I started my most recent build with the following: > > > > · OSG developer release 3.3.2 > > · osgEarth trunk (08/07/2014) > > · Visual Studio 2013 Pro update 2 > > · OSG prebuilt dependencies for VS2013 > > · Qt Enterprise 5.3.1 for VS2013 32-bit, *without* Desktop OpenGL > (I see no reason why this shouldn’t work as well with Qt Open Source) > > · Sqlite and geos, built from source with VS2013 for osgEarth > > > > The process I followed was as follows > > > > · Using CMake Gui, Configure osg for OpenGL ES 2.0 (as per here > http://trac.openscenegraph.org/projects/osg/wiki/Community/OpenGL-ES ) > > · Set the opengl library to be libgles2 (release) and libgles2d > (debug) > > · Set use Qt to OFF > > · Create visual studio project > > > > Then in Visual Studio > > > > · Remove GraphicsWindowWin32 and PixelBufferWin32 cpp files from > the osgViewer project > > · Add to the Include Directories in the VC++ Directories section > of all the project properties <qtdir>\ include\QtANGLE > > · Add to the Libraries Directories <qtdir>\lib (group-selecting > all the projects in Solution Explorer makes that easier) > > · Edit the osg::getGLExtensionFuncPtr function to load > libgles2d.dll for debug builds > > · Build the solution > > > > OsgEarth requires similar changes – set the name of the opengl es library > appropriately in CMake, and add the include and library paths in Visual > Studio. > > > > It was then possible to integrate osg with QT Quick’s ANGLE-based OpenGL > ES 2.0 contexts by overriding the background-drawing code of QQuickView > using osgViewer::GraphicsWindowEmbedded. > > > > > > The principal remaining issue is that neither the osgviewer executable nor > any of the examples will run, since there is no code to set up windows for > them – that would require integration of ANGLE’s version of EGL in place of > the deleted GraphicsWindowWin32 etc. Also, this build process is not > compatible with osgQt, but it should be able to be made compatible, since > the old QGLWidget code should still work via ANGLE if it is made to use > OpenGL ES 2.0 calls. I did not need any of that though, so I have not > investigated further. > > > > Hopefully this information will be useful for anyone else who wants to use > ANGLE on Windows with OpenSceneGraph, and it would be great if somebody who > is sufficiently expert with CMake could fix the setup issues so that there > was less hacking of the generated Visual Studio projects required. > > > > > > Alistair Baxter > Software Engineer > ________________________________ > Have you upgraded FieldMove Clino to FieldMove Clino Pro? In-app > purchase from these app stores: > > <https://itunes.apple.com/us/app/fieldmove-clino/id647463813?mt=8> > <https://play.google.com/store/apps/details?id=com.mve.fieldmove.clino> > > Midland Valley Exploration Ltd. > 2 West Regent Street > Glasgow G2 1RW > United Kingdom > > Tel: +44 (0) 141 332 2681 > Fax: +44 (0) 141 332 6792 > > The structural geology experts > > > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > > -- Chris 'Xenon' Hanson, omo sanza lettere. xe...@alphapixel.com http://www.alphapixel.com/ Training • Consulting • Contracting 3D • Scene Graphs (Open Scene Graph/OSG) • OpenGL 2 • OpenGL 3 • OpenGL 4 • GLSL • OpenGL ES 1 • OpenGL ES 2 • OpenCL Digital Imaging • GIS • GPS • osgEarth • Terrain • Telemetry • Cryptography • Digital Audio • LIDAR • Kinect • Embedded • Mobile • iPhone/iPad/iOS • Android @alphapixel <https://twitter.com/alphapixel> facebook.com/alphapixel (775) 623-PIXL [7495]
_______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org