Hi Alistair,
   Great work,before we used a GLES Modified SDL+ANGLE to let OSG run in 
directx mode.
   zhuwan
   07,11,2014



在2014-7-10 21:16:25,"Alistair Baxter" <[email protected]> 写道: -----原始邮件-----
发件人: "Alistair Baxter" <[email protected]>
发送时间: 2014-7-10 21:16:25
收件人: "OpenSceneGraph Users" <[email protected]>
主题: [osg-users] OpenSceneGraph using ANGLE on Windows



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:

   

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
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to