diff --git a/CMake/Packaging.cmake b/CMake/Packaging.cmake index cf52978907d..9ecb408bde0 100644 --- a/CMake/Packaging.cmake +++ b/CMake/Packaging.cmake @@ -20,7 +20,7 @@ set(CPACK_PACKAGE_VENDOR "Torus Knot Software") # CPack won't allow file without recognized extension to be used as # license file. -file(COPY "${OGRE_SOURCE_DIR}/LICENSE" DESTINATION "${OGRE_BINARY_DIR}/LICENSE.txt") +configure_file("${OGRE_SOURCE_DIR}/LICENSE" "${OGRE_BINARY_DIR}/LICENSE.txt" COPYONLY) set(CPACK_RESOURCE_FILE_LICENSE "${OGRE_BINARY_DIR}/LICENSE.txt") #set(CPACK_PACKAGE_ICON "${OGRE_SOURCE_DIR}\\\\ogrelogo.gif") diff --git a/CMake/toolchain/android.toolchain.cmake b/CMake/toolchain/android.toolchain.cmake index fe3063df381..c607f75f1e8 100644 --- a/CMake/toolchain/android.toolchain.cmake +++ b/CMake/toolchain/android.toolchain.cmake @@ -1392,11 +1392,11 @@ endif() if( ANDROID_STL MATCHES "gnustl" AND (EXISTS "${__libstl}" OR EXISTS "${__libsupcxx}") ) set( CMAKE_CXX_CREATE_SHARED_LIBRARY " -o " ) - set( CMAKE_CXX_CREATE_SHARED_MODULE " -o " ) + set( CMAKE_CXX_CREATE_SHARED_MODULE " -o " ) set( CMAKE_CXX_LINK_EXECUTABLE " -o " ) else() set( CMAKE_CXX_CREATE_SHARED_LIBRARY " -o " ) - set( CMAKE_CXX_CREATE_SHARED_MODULE " -o " ) + set( CMAKE_CXX_CREATE_SHARED_MODULE " -o " ) set( CMAKE_CXX_LINK_EXECUTABLE " -o " ) endif() diff --git a/Components/Bites/include/OgreApplicationContext.h b/Components/Bites/include/OgreApplicationContext.h index 3b4dea49196..b8ee4a8c985 100644 --- a/Components/Bites/include/OgreApplicationContext.h +++ b/Components/Bites/include/OgreApplicationContext.h @@ -99,7 +99,7 @@ namespace OgreBites public Ogre::WindowEventListener { public: - explicit ApplicationContext(const Ogre::String& appName = OGRE_VERSION_NAME, bool grabInput = true); + explicit ApplicationContext(const Ogre::String& appName = OGRE_VERSION_NAME, bool unused = true); virtual ~ApplicationContext(); @@ -194,9 +194,15 @@ namespace OgreBites virtual bool oneTimeConfig(); /** - Sets up SDL input. + When input is grabbed the mouse is confined to the window. */ - virtual void setupInput(bool grab); + void setWindowGrab(NativeWindowType* win, bool grab = true); + + /// @overload + void setWindowGrab(bool grab = true) { + OgreAssert(!mWindows.empty(), "create a window first"); + setWindowGrab(mWindows[0].native, grab); + } /** Finds context-wide resource groups. I load paths from a config file here, @@ -265,7 +271,7 @@ namespace OgreBites /// @overload void removeInputListener(InputListener* lis) { - OgreAssert(!mWindows.empty(), "called after all windows we deleted"); + OgreAssert(!mWindows.empty(), "called after all windows were deleted"); removeInputListener(mWindows[0].native, lis); } @@ -303,7 +309,6 @@ namespace OgreBites Ogre::FileSystemLayer* mFSLayer; // File system abstraction layer Ogre::Root* mRoot; // OGRE root StaticPluginLoader mStaticPluginLoader; - bool mGrabInput; bool mFirstRun; Ogre::String mNextRenderer; // name of renderer used for next run Ogre::String mAppName; diff --git a/Components/Bites/src/OgreApplicationContext.cpp b/Components/Bites/src/OgreApplicationContext.cpp index 3d9eb53469e..ea0bae1012c 100644 --- a/Components/Bites/src/OgreApplicationContext.cpp +++ b/Components/Bites/src/OgreApplicationContext.cpp @@ -33,13 +33,12 @@ namespace OgreBites { static const char* SHADER_CACHE_FILENAME = "cache.bin"; -ApplicationContext::ApplicationContext(const Ogre::String& appName, bool grabInput) +ApplicationContext::ApplicationContext(const Ogre::String& appName, bool) #if (OGRE_THREAD_PROVIDER == 3) && (OGRE_NO_TBB_SCHEDULER == 1) : mTaskScheduler(tbb::task_scheduler_init::deferred) #endif { mAppName = appName; - mGrabInput = grabInput; mFSLayer = new Ogre::FileSystemLayer(mAppName); mRoot = NULL; mOverlaySystem = NULL; @@ -196,7 +195,6 @@ void ApplicationContext::setup() mRoot->initialise(false); createWindow(mAppName); - setupInput(mGrabInput); locateResources(); initialiseRTShaderSystem(); loadResources(); @@ -530,21 +528,12 @@ void ApplicationContext::_fireInputEvent(const Event& event, uint32_t windowID) } } -void ApplicationContext::setupInput(bool _grab) +void ApplicationContext::setWindowGrab(NativeWindowType* win, bool _grab) { #if OGRE_BITES_HAVE_SDL - if (!mWindows[0].native) - { - OGRE_EXCEPT(Ogre::Exception::ERR_INVALID_STATE, - "you must create a SDL window first", - "SampleContext::setupInput"); - } - - SDL_ShowCursor(SDL_FALSE); - SDL_bool grab = SDL_bool(_grab); - SDL_SetWindowGrab(mWindows[0].native, grab); + SDL_SetWindowGrab(win, grab); SDL_SetRelativeMouseMode(grab); #endif } diff --git a/Components/Java/CMakeLists.txt b/Components/Java/CMakeLists.txt index c95a106b222..d1b48ef78ee 100644 --- a/Components/Java/CMakeLists.txt +++ b/Components/Java/CMakeLists.txt @@ -75,5 +75,4 @@ swig_add_module(OgreJNI java ${SWIG_INPUT_MODULES}) swig_link_libraries(OgreJNI OgreBites OgreOverlay OgreRTShaderSystem OgreMain ${JNI_LIBRARIES}) if(ANDROID) set_target_properties(${SWIG_MODULE_OgreJNI_REAL_NAME} PROPERTIES LINK_FLAGS -s) # strip symbols - set_target_properties(${SWIG_MODULE_OgreJNI_REAL_NAME} PROPERTIES NO_SONAME OFF) # workaround for SWIG/ android interop endif() \ No newline at end of file diff --git a/OgreMain/include/Ogre.i b/OgreMain/include/Ogre.i index a6d08034b7f..835023b1577 100644 --- a/OgreMain/include/Ogre.i +++ b/OgreMain/include/Ogre.i @@ -152,6 +152,7 @@ JNIEnv* OgreJNIGetEnv() { %ignore Ogre::SharedPtr::unspecified_bool; // c++11 compatibility %include "OgreSharedPtr.h" %ignore Ogre::Any::getType; // deprecated +%ignore Ogre::Any::destroy; // deprecated %include "OgreAny.h" %include "OgreIteratorWrapper.h" %include "OgreMath.h" @@ -279,7 +280,7 @@ ADD_REPR(ColourValue) %template(HardwareIndexBufferPtr) Ogre::SharedPtr; %include "OgreHardwareIndexBuffer.h" %template(HardwarePixelBufferPtr) Ogre::SharedPtr; -#ifdef __ANDROID__ +#ifdef SWIGJAVA %ignore Ogre::HardwarePixelBuffer::lock; // duplicate definition #endif %include "OgreHardwarePixelBuffer.h" diff --git a/OgreMain/include/OgreAny.h b/OgreMain/include/OgreAny.h index 9d3ca4fa7b3..f9a93bef3f9 100644 --- a/OgreMain/include/OgreAny.h +++ b/OgreMain/include/OgreAny.h @@ -135,7 +135,7 @@ namespace Ogre } /// @deprecated use reset() instead - void destroy() { reset(); } + OGRE_DEPRECATED void destroy() { reset(); } protected: // types diff --git a/OgreMain/include/OgreRenderSystemCapabilities.h b/OgreMain/include/OgreRenderSystemCapabilities.h index 7a7b3df90a4..adc157093f0 100644 --- a/OgreMain/include/OgreRenderSystemCapabilities.h +++ b/OgreMain/include/OgreRenderSystemCapabilities.h @@ -286,19 +286,19 @@ namespace Ogre GPU_NVIDIA = 1, GPU_AMD = 2, GPU_INTEL = 3, - GPU_S3 = 4, - GPU_MATROX = 5, - GPU_3DLABS = 6, - GPU_SIS = 7, + GPU_S3 = 4, //!< @deprecated + GPU_MATROX = 5, //!< @deprecated + GPU_3DLABS = 6, //!< @deprecated + GPU_SIS = 7, //!< @deprecated GPU_IMAGINATION_TECHNOLOGIES = 8, - GPU_APPLE = 9, // Apple Software Renderer + GPU_APPLE = 9, //!< Apple Software Renderer GPU_NOKIA = 10, - GPU_MS_SOFTWARE = 11, // Microsoft software device - GPU_MS_WARP = 12, // Microsoft WARP (Windows Advanced Rasterization Platform) software device - http://msdn.microsoft.com/en-us/library/dd285359.aspx - GPU_ARM = 13, // For the Mali chipsets + GPU_MS_SOFTWARE = 11, //!< Microsoft software device + GPU_MS_WARP = 12, //!< Microsoft WARP (Windows Advanced Rasterization Platform) software device - http://msdn.microsoft.com/en-us/library/dd285359.aspx + GPU_ARM = 13, //!< For the Mali chipsets GPU_QUALCOMM = 14, - GPU_MOZILLA = 15, // WebGL on Mozilla/Firefox based browser - GPU_WEBKIT = 16, // WebGL on WebKit/Chrome base browser + GPU_MOZILLA = 15, //!< WebGL on Mozilla/Firefox based browser + GPU_WEBKIT = 16, //!< WebGL on WebKit/Chrome base browser /// placeholder GPU_VENDOR_COUNT = 17 }; @@ -402,10 +402,9 @@ namespace Ogre ushort mNumVertexAttributes; public: RenderSystemCapabilities (); - virtual ~RenderSystemCapabilities () {} /// @deprecated - OGRE_DEPRECATED virtual size_t calculateSize() const {return 0;} + OGRE_DEPRECATED size_t calculateSize() const {return 0;} /** Set the driver version. */ void setDriverVersion(const DriverVersion& version) diff --git a/OgreMain/include/OgreWorkQueue.h b/OgreMain/include/OgreWorkQueue.h index be4404c1662..f2a4b8c149a 100644 --- a/OgreMain/include/OgreWorkQueue.h +++ b/OgreMain/include/OgreWorkQueue.h @@ -143,7 +143,7 @@ namespace Ogre /// Return the response data (user defined, only valid on success) const Any& getData() const { return mData; } /// Abort the request - void abortRequest() { mRequest->abortRequest(); mData.destroy(); } + void abortRequest() { mRequest->abortRequest(); mData.reset(); } }; /** Interface definition for a handler of requests. diff --git a/PlugIns/CgProgramManager/src/OgreCgProgram.cpp b/PlugIns/CgProgramManager/src/OgreCgProgram.cpp index 6e8be1baa1b..fb010cffd70 100644 --- a/PlugIns/CgProgramManager/src/OgreCgProgram.cpp +++ b/PlugIns/CgProgramManager/src/OgreCgProgram.cpp @@ -729,11 +729,15 @@ namespace Ogre { // Cg logs its renamings in the comments at the beginning of the // processed source file. We can get them from there. // We'll also get rid of those comments to trim down source code size. +#if OGRE_DEBUG_MODE LogManager::getSingleton().stream() << "Cg high level output for " << getName() << ":\n" << hlSource; +#endif hlSource = HighLevelOutputFixer(hlSource, mParametersMap, mSamplerRegisterMap, mSelectedCgProfile == CG_PROFILE_GLSLV || mSelectedCgProfile == CG_PROFILE_GLSLF || mSelectedCgProfile == CG_PROFILE_GLSLG).output; +#if OGRE_DEBUG_MODE LogManager::getSingleton().stream() << "Cleaned high level output for " << getName() << ":\n" << hlSource; +#endif } diff --git a/RenderSystems/GL/src/OgreGLRenderSystem.cpp b/RenderSystems/GL/src/OgreGLRenderSystem.cpp index 00c7af461ab..4b34e35d3e5 100644 --- a/RenderSystems/GL/src/OgreGLRenderSystem.cpp +++ b/RenderSystems/GL/src/OgreGLRenderSystem.cpp @@ -2732,18 +2732,6 @@ namespace Ogre { RenderSystem::_render(op); mMaxBuiltInTextureAttribIndex = 0; - if ( ! mEnableFixedPipeline && !mRealCapabilities->hasCapability(RSC_FIXED_FUNCTION) - && - ( - ( mCurrentVertexProgram == NULL ) || - ( mCurrentFragmentProgram == NULL && op.operationType != RenderOperation::OT_POINT_LIST) - ) - ) - { - OGRE_EXCEPT(Exception::ERR_RENDERINGAPI_ERROR, - "Attempted to render using the fixed pipeline when it is disabled.", - "GLRenderSystem::_render"); - } HardwareVertexBufferSharedPtr globalInstanceVertexBuffer = getGlobalInstanceVertexBuffer(); VertexDeclaration* globalVertexDeclaration = getGlobalInstanceVertexBufferVertexDeclaration(); diff --git a/Samples/Browser/include/SampleBrowser.h b/Samples/Browser/include/SampleBrowser.h index 90116edbe61..e77233d2ec3 100644 --- a/Samples/Browser/include/SampleBrowser.h +++ b/Samples/Browser/include/SampleBrowser.h @@ -149,7 +149,7 @@ namespace OgreBites public: SampleBrowser(bool nograb = false, int startSampleIndex = -1) - : SampleContext("OGRE Sample Browser", !nograb) + : SampleContext("OGRE Sample Browser"), mGrabInput(!nograb) { mIsShuttingDown = false; mTrayMgr = 0; @@ -919,6 +919,7 @@ namespace OgreBites ApplicationContext::setup(); mWindow = getRenderWindow(); addInputListener(this); + if(mGrabInput) setWindowGrab(); #ifdef OGRE_STATIC_LIB // Check if the render system supports any shader profiles. // Don't load samples that require shaders if we don't have any shader support, GL ES 1.x for example. @@ -1509,6 +1510,7 @@ namespace OgreBites SampleBrowserGestureView *mGestureView; #endif bool mIsShuttingDown; + bool mGrabInput; }; } diff --git a/Samples/Common/include/SampleContext.h b/Samples/Common/include/SampleContext.h index 1146105a87e..cccc847c04a 100644 --- a/Samples/Common/include/SampleContext.h +++ b/Samples/Common/include/SampleContext.h @@ -44,8 +44,8 @@ namespace OgreBites public: Ogre::RenderWindow* mWindow; - SampleContext(const Ogre::String& appName = OGRE_VERSION_NAME, bool grabInput = true) - : ApplicationContext(appName, grabInput), mWindow(NULL) + SampleContext(const Ogre::String& appName = OGRE_VERSION_NAME) + : ApplicationContext(appName), mWindow(NULL) { mCurrentSample = 0; mSamplePaused = false; diff --git a/Samples/Grass/include/Grass.h b/Samples/Grass/include/Grass.h index 046bb0daaae..82bf751bf66 100644 --- a/Samples/Grass/include/Grass.h +++ b/Samples/Grass/include/Grass.h @@ -165,6 +165,7 @@ class _OgreSampleClassExport Sample_Grass : public SdkSample setupLighting(); mCameraMan->setStyle(CS_ORBIT); + mTrayMgr->showCursor(); mCameraMan->setYawPitchDist(Degree(0), Degree(25), 200); } diff --git a/Samples/HLMS/include/HLMS.h b/Samples/HLMS/include/HLMS.h index 8250e061e88..735402fa08a 100644 --- a/Samples/HLMS/include/HLMS.h +++ b/Samples/HLMS/include/HLMS.h @@ -158,6 +158,7 @@ class _OgreSampleClassExport Sample_HLMS : public SdkSample } mCameraMan->setStyle(CS_ORBIT); + mTrayMgr->showCursor(); mCameraMan->setYawPitchDist(Degree(0), Degree(25), 20); mCameraMan->setTopSpeed(5); mCamera->setNearClipDistance(1); diff --git a/Samples/SkeletalAnimation/include/SkeletalAnimation.h b/Samples/SkeletalAnimation/include/SkeletalAnimation.h index dc15cfafa9b..918542b7a45 100644 --- a/Samples/SkeletalAnimation/include/SkeletalAnimation.h +++ b/Samples/SkeletalAnimation/include/SkeletalAnimation.h @@ -230,6 +230,7 @@ class _OgreSampleClassExport Sample_SkeletalAnimation : public SdkSample // set camera initial transform and speed mCameraMan->setStyle(CS_ORBIT); + mTrayMgr->showCursor(); mCameraMan->setYawPitchDist(Degree(0), Degree(25), 100); mCameraMan->setTopSpeed(50); diff --git a/Tests/VisualTests/PlayPen/src/PlayPenTestPlugin.cpp b/Tests/VisualTests/PlayPen/src/PlayPenTestPlugin.cpp index 38b8b8b100f..f4a7a60259a 100644 --- a/Tests/VisualTests/PlayPen/src/PlayPenTestPlugin.cpp +++ b/Tests/VisualTests/PlayPen/src/PlayPenTestPlugin.cpp @@ -145,11 +145,14 @@ PlaypenTestPlugin::PlaypenTestPlugin() addSample(new PlayPen_InfiniteAAB()); #ifndef ONLY_COMMON_GL_TESTS - if (Root::getSingletonPtr()->getRenderSystem()->getName().find("OpenGL ES 2") == String::npos && - Root::getSingletonPtr()->getRenderSystem()->getName().find("OpenGL 3+") == String::npos) + if (Root::getSingletonPtr()->getRenderSystem()->getCapabilities()->hasCapability(RSC_FIXED_FUNCTION)) { addSample(new PlayPen_MaterialSchemesWithLOD()); addSample(new PlayPen_MaterialSchemesWithMismatchedLOD()); + } + + if (Root::getSingletonPtr()->getRenderSystem()->getName().find("OpenGL ES 2") == String::npos) + { addSample(new PlayPen_SpotlightViewProj()); // Only Cg at this time addSample(new PlayPen_TextureShadowsCustomCasterMat()); // Only Cg at this time addSample(new PlayPen_TextureShadowsCustomReceiverMat()); // Only Cg at this time diff --git a/Tests/VisualTests/PlayPen/src/PlayPenTests.cpp b/Tests/VisualTests/PlayPen/src/PlayPenTests.cpp index 686eadf9094..3f35834a7ef 100644 --- a/Tests/VisualTests/PlayPen/src/PlayPenTests.cpp +++ b/Tests/VisualTests/PlayPen/src/PlayPenTests.cpp @@ -5822,7 +5822,7 @@ void PlayPen_SpotlightViewProj::setupContent() TRANSIENT_RESOURCE_GROUP, "cg", GPT_VERTEX_PROGRAM); vp->setSource(vpStr); - vp->setParameter("profiles", "vs_1_1 arbvp1"); + vp->setParameter("profiles", "vs_1_1 arbvp1 glslv"); vp->setParameter("entry_point", "vp"); vp->load(); @@ -5831,7 +5831,7 @@ void PlayPen_SpotlightViewProj::setupContent() TRANSIENT_RESOURCE_GROUP, "cg", GPT_FRAGMENT_PROGRAM); fp->setSource(fpStr); - fp->setParameter("profiles", "ps_2_0 arbfp1"); + fp->setParameter("profiles", "ps_2_0 arbfp1 glslf"); fp->setParameter("entry_point", "fp"); fp->load(); @@ -6778,7 +6778,7 @@ void PlayPen_TextureShadowsCustomCasterMat::setupContent() TRANSIENT_RESOURCE_GROUP, "cg", GPT_VERTEX_PROGRAM); vp->setSource(customCasterMatVp); - vp->setParameter("profiles", "vs_1_1 arbvp1"); + vp->setParameter("profiles", "vs_1_1 arbvp1 glslv"); vp->setParameter("entry_point", "customCasterVp"); vp->load(); @@ -6787,7 +6787,7 @@ void PlayPen_TextureShadowsCustomCasterMat::setupContent() TRANSIENT_RESOURCE_GROUP, "cg", GPT_FRAGMENT_PROGRAM); fp->setSource(customCasterMatFp); - fp->setParameter("profiles", "ps_1_1 arbfp1"); + fp->setParameter("profiles", "ps_1_1 arbfp1 glslf"); fp->setParameter("entry_point", "customCasterFp"); fp->load(); @@ -6847,7 +6847,7 @@ void PlayPen_TextureShadowsCustomReceiverMat::setupContent() TRANSIENT_RESOURCE_GROUP, "cg", GPT_VERTEX_PROGRAM); vp->setSource(customReceiverMatVp); - vp->setParameter("profiles", "vs_1_1 arbvp1"); + vp->setParameter("profiles", "vs_1_1 arbvp1 glslv"); vp->setParameter("entry_point", "customReceiverVp"); vp->load(); @@ -6856,7 +6856,7 @@ void PlayPen_TextureShadowsCustomReceiverMat::setupContent() TRANSIENT_RESOURCE_GROUP, "cg", GPT_FRAGMENT_PROGRAM); fp->setSource(customReceiverMatFp); - fp->setParameter("profiles", "ps_1_1 arbfp1"); + fp->setParameter("profiles", "ps_1_1 arbfp1 glslf"); fp->setParameter("entry_point", "customReceiverFp"); fp->load(); diff --git a/ci-build.cmake b/ci-build.cmake index bd0e037e552..7f4eeb49d76 100644 --- a/ci-build.cmake +++ b/ci-build.cmake @@ -55,7 +55,7 @@ endif() if(DEFINED ENV{ANDROID}) set(CROSS -DANDROID_NATIVE_API_LEVEL=16 - -DANDROID_NDK=${CMAKE_CURRENT_SOURCE_DIR}/android-ndk-r15b + -DANDROID_NDK=${CMAKE_CURRENT_SOURCE_DIR}/android-ndk-r15c -DCMAKE_TOOLCHAIN_FILE=${CMAKE_CURRENT_SOURCE_DIR}/CMake/toolchain/android.toolchain.cmake "-DANDROID_ABI=armeabi-v7a with NEON") @@ -71,13 +71,13 @@ if(DEFINED ENV{ANDROID}) -DOGRE_DEPENDENCIES_DIR=${CMAKE_CURRENT_SOURCE_DIR}/ogredeps) set(BUILD_DEPS TRUE) - if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/android-ndk-r15b) + if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/android-ndk-r15c) message(STATUS "Downloading Android NDK") file(DOWNLOAD - http://dl.google.com/android/repository/android-ndk-r15b-linux-x86_64.zip - ./android-ndk-r15b-linux-x86_64.zip) + http://dl.google.com/android/repository/android-ndk-r15c-linux-x86_64.zip + ./android-ndk-r15c-linux-x86_64.zip) message(STATUS "Extracting Android NDK") - execute_process(COMMAND unzip android-ndk-r15b-linux-x86_64.zip OUTPUT_QUIET) + execute_process(COMMAND unzip android-ndk-r15c-linux-x86_64.zip OUTPUT_QUIET) endif() endif()