diff options
author | Koen Kooi <koen@openembedded.org> | 2009-02-08 19:29:56 +0100 |
---|---|---|
committer | Koen Kooi <koen@openembedded.org> | 2009-02-08 19:29:56 +0100 |
commit | 7140be31f571c47bcf3ffc1e55eb758f741b8f50 (patch) | |
tree | 4c1e2a0a7357ea5f6bb1c4ea59e43c90eac7db76 | |
parent | e32c4220bd919b0c1405f4a6661bab8db6a22060 (diff) |
ogre gles: add recipe to build an openGL|ES version of the ogre 3D engine
-rw-r--r-- | packages/ogre/files/ogre-egl-update.diff | 165 | ||||
-rw-r--r-- | packages/ogre/ogre-egl_svn.bb | 29 |
2 files changed, 194 insertions, 0 deletions
diff --git a/packages/ogre/files/ogre-egl-update.diff b/packages/ogre/files/ogre-egl-update.diff new file mode 100644 index 0000000000..9173715ee3 --- /dev/null +++ b/packages/ogre/files/ogre-egl-update.diff @@ -0,0 +1,165 @@ +Index: RenderSystems/GLES/include/OgreGLESSupport.h +=================================================================== +--- RenderSystems/GLES/include/OgreGLESSupport.h (revision 8310) ++++ RenderSystems/GLES/include/OgreGLESSupport.h (working copy) +@@ -80,6 +80,11 @@ + virtual void initialiseExtensions(); + virtual bool checkExtension(const String& ext) const; + ++ virtual unsigned int getDisplayMonitorCount() const ++ { ++ return 1; ++ } ++ + virtual void start() = 0; + virtual void stop() = 0; + +Index: RenderSystems/GLES/include/OgreGLESRenderSystem.h +=================================================================== +--- RenderSystems/GLES/include/OgreGLESRenderSystem.h (revision 8310) ++++ RenderSystems/GLES/include/OgreGLESRenderSystem.h (working copy) +@@ -139,9 +139,11 @@ + void _setTextureBorderColour(size_t stage, const ColourValue& colour); + void _setTextureMipmapBias(size_t unit, float bias); + void _setTextureMatrix(size_t stage, const Matrix4& xform); +- void _setSceneBlending(SceneBlendFactor sourceFactor, SceneBlendFactor destFactor); +- void _setSeparateSceneBlending(SceneBlendFactor sourceFactor, SceneBlendFactor destFactor, SceneBlendFactor sourceFactorAlpha, SceneBlendFactor destFactorAlpha); +- void _setAlphaRejectSettings(CompareFunction func, unsigned char value); ++ void _setSceneBlending(SceneBlendFactor sourceFactor, SceneBlendFactor destFactor, SceneBlendOperation op ); ++ void _setSeparateSceneBlending(SceneBlendFactor sourceFactor, SceneBlendFactor destFactor, SceneBlendFactor sourceFactorAlpha, SceneBlendFactor destFactorAlpha, SceneBlendOperation op, SceneBlendOperation alphaOp ); ++ void _setSceneBlendingOperation(SceneBlendOperation op); ++ void _setSeparateSceneBlendingOperation(SceneBlendOperation op, SceneBlendOperation alphaOp); ++ void _setAlphaRejectSettings(CompareFunction func, unsigned char value, bool alphaToCoverage); + void _setViewport(Viewport *vp); + void _beginFrame(void); + void _endFrame(void); +@@ -195,6 +197,7 @@ + + GLESContext* _getMainContext() { return mMainContext; } + void _unregisterContext(GLESContext *context); ++ unsigned int getDisplayMonitorCount() const; + void _switchContext(GLESContext *context); + void _oneTimeContextInitialization(); + void initialiseContext(RenderWindow* primary); +Index: RenderSystems/GLES/include/OgreGLESDefaultHardwareBufferManager.h +=================================================================== +--- RenderSystems/GLES/include/OgreGLESDefaultHardwareBufferManager.h (revision 8310) ++++ RenderSystems/GLES/include/OgreGLESDefaultHardwareBufferManager.h (working copy) +@@ -110,6 +110,8 @@ + HardwareIndexBufferSharedPtr + createIndexBuffer(HardwareIndexBuffer::IndexType itype, size_t numIndexes, + HardwareBuffer::Usage usage, bool useShadowBuffer = false); ++ // Create a render to vertex buffer ++ RenderToVertexBufferSharedPtr createRenderToVertexBuffer(); + }; + } + +Index: RenderSystems/GLES/src/OgreGLESRenderSystem.cpp +=================================================================== +--- RenderSystems/GLES/src/OgreGLESRenderSystem.cpp (revision 8310) ++++ RenderSystems/GLES/src/OgreGLESRenderSystem.cpp (working copy) +@@ -1182,7 +1182,8 @@ + return GL_ONE; + } + +- void GLESRenderSystem::_setSceneBlending(SceneBlendFactor sourceFactor, SceneBlendFactor destFactor) ++ ++ void GLESRenderSystem::_setSceneBlending(SceneBlendFactor sourceFactor, SceneBlendFactor destFactor, SceneBlendOperation op ) + { + GLint sourceBlend = getBlendMode(sourceFactor); + GLint destBlend = getBlendMode(destFactor); +@@ -1199,17 +1200,19 @@ + GL_CHECK_ERROR; + } + } +- +- void GLESRenderSystem::_setSeparateSceneBlending(SceneBlendFactor sourceFactor, +- SceneBlendFactor destFactor, +- SceneBlendFactor sourceFactorAlpha, +- SceneBlendFactor destFactorAlpha) ++ ++ void GLESRenderSystem::_setSeparateSceneBlending( ++ SceneBlendFactor sourceFactor, SceneBlendFactor destFactor, ++ SceneBlendFactor sourceFactorAlpha, SceneBlendFactor destFactorAlpha, ++ SceneBlendOperation op, SceneBlendOperation alphaOp ) + { + // Not supported + } + +- void GLESRenderSystem::_setAlphaRejectSettings(CompareFunction func, unsigned char value) ++ void GLESRenderSystem::_setAlphaRejectSettings(CompareFunction func, unsigned char value, bool alphaToCoverage) + { ++ bool a2c = false; ++ static bool lasta2c = false; + if (func == CMPF_ALWAYS_PASS) + { + glDisable(GL_ALPHA_TEST); +@@ -1222,6 +1225,15 @@ + glAlphaFunc(convertCompareFunction(func), value / 255.0f); + GL_CHECK_ERROR; + } ++ if (a2c != lasta2c && getCapabilities()->hasCapability(RSC_ALPHA_TO_COVERAGE)) ++ { ++ if (a2c) ++ glEnable(GL_SAMPLE_ALPHA_TO_COVERAGE); ++ else ++ glDisable(GL_SAMPLE_ALPHA_TO_COVERAGE); ++ ++ lasta2c = a2c; ++ } + } + + void GLESRenderSystem::_setViewport(Viewport *vp) +@@ -2084,7 +2096,12 @@ + { + // Not implemented + } +- ++ ++ unsigned int GLESRenderSystem::getDisplayMonitorCount() const ++ { ++ return mGLSupport->getDisplayMonitorCount(); ++ } ++ + void GLESRenderSystem::setClipPlanesImpl(const Ogre::PlaneList& clipPlanes) + { + // A note on GL user clipping: +Index: RenderSystems/GLES/src/OgreGLESDefaultHardwareBufferManager.cpp +=================================================================== +--- RenderSystems/GLES/src/OgreGLESDefaultHardwareBufferManager.cpp (revision 8310) ++++ RenderSystems/GLES/src/OgreGLESDefaultHardwareBufferManager.cpp (working copy) +@@ -164,4 +164,12 @@ + return HardwareIndexBufferSharedPtr( + new GLESDefaultHardwareIndexBuffer(itype, numIndexes, usage)); + } ++ ++ RenderToVertexBufferSharedPtr ++ GLESDefaultHardwareBufferManager::createRenderToVertexBuffer() ++ { ++ OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, ++ "Cannot create RenderToVertexBuffer in GLESDefaultHardwareBufferManager", ++ "GLESDefaultHardwareBufferManager::createRenderToVertexBuffer"); ++ } + } +Index: RenderSystems/GLES/src/EGL/OgreEGLWindow.cpp +=================================================================== +--- RenderSystems/GLES/src/EGL/OgreEGLWindow.cpp (revision 8310) ++++ RenderSystems/GLES/src/EGL/OgreEGLWindow.cpp (working copy) +@@ -182,7 +182,7 @@ + + if ((opt = miscParams->find("parentWindowHandle")) != end) + { +- std::vector<String> tokens = StringUtil::split(opt->second, " :"); ++ StringVector tokens = StringUtil::split(opt->second, " :"); + + if (tokens.size() == 3) + { +@@ -197,7 +197,7 @@ + } + else if ((opt = miscParams->find("externalWindowHandle")) != end) + { +- std::vector<String> tokens = StringUtil::split(opt->second, " :"); ++ StringVector tokens = StringUtil::split(opt->second, " :"); + + LogManager::getSingleton().logMessage( + "EGLWindow::create: The externalWindowHandle parameter is deprecated.\n" diff --git a/packages/ogre/ogre-egl_svn.bb b/packages/ogre/ogre-egl_svn.bb new file mode 100644 index 0000000000..8cecf56a7d --- /dev/null +++ b/packages/ogre/ogre-egl_svn.bb @@ -0,0 +1,29 @@ +DESCRIPTION = "OGRE (Object-Oriented Graphics Rendering Engine) is a scene-oriented, flexible 3D engine " +LICENSE = "LGPL" +DEPENDS = "zziplib boost freeimage freetype virtual/libx11 virtual/egl" + +SRCREV = "8310" +PV = "1.6.1+svnr${SRCREV}" + +SRC_URI = "svn://ogre.svn.sourceforge.net/svnroot/ogre;module=trunk;proto=https \ + file://ogre-egl-update.diff;patch=1;pnum=0 \ + " + +inherit autotools_stage + +# This is the EGL version +EXTRA_OECONF = " --with-allocator=std --enable-threading=no --disable-cg --enable-gles " + +S = "${WORKDIR}/trunk" + + +EXTRA_OEMAKE = " ZZIPLIB_CFLAGS=\"${@base_conditional('SITEINFO_ENDIANESS', 'le', '-DOGRE_CONFIG_LITTLE_ENDIAN', '-DOGRE_CONFIG_BIG_ENDIAN', d)}\" " + +do_configure_prepend() { + sed -i -e /OGRE_DETECT_ENDIAN/d ${S}/configure.in +} + +FILES_${PN}-dbg += "${libdir}/OGRE/.debug" +FILES_${PN}-dev += "${libdir}/OGRE/*.la" +FILES_${PN} += "${libdir}/OGRE/*.so" + |