Anonymous avatar Anonymous committed 8729ae7

* RenderSystem_NULL is successfully linked as DLL
* added all shaders profiles to NULL rs capabilities

Comments (0)

Files changed (4)

 
 add_definitions(-D_USRDLL)
 
-add_library (RenderSystem_NULL SHARED
+set (SOURCE_FILES
 	NullGpuProgram.h
 	NullGpuProgramManager.cpp
 	NullGpuProgramManager.h
 	stdafx.h
 )
 
+add_library(RenderSystem_NULL ${OGRE_LIB_TYPE} ${SOURCE_FILES})
+
 target_link_libraries(RenderSystem_NULL
   OgreMain
 )
 
+if (NOT OGRE_STATIC)
+  set_target_properties(RenderSystem_NULL PROPERTIES
+      COMPILE_DEFINITIONS OGRENULLRSDLL_EXPORTS
+  )
+endif ()
+
+

NullRenderSystem.cpp

 		mRealCapabilities->setCapability(RSC_POINT_SPRITES);
 		mRealCapabilities->setCapability(RSC_POINT_EXTENDED_PARAMETERS);
 		mRealCapabilities->setMaxPointSize(256);
+		
+		mRealCapabilities->addShaderProfile( "vs_1_1" );
+        mRealCapabilities->addShaderProfile( "vs_2_0" );
+        mRealCapabilities->addShaderProfile( "vs_2_x" );
+        mRealCapabilities->addShaderProfile( "vs_3_0" );
+        mRealCapabilities->addShaderProfile( "arbvp1" );
+        mRealCapabilities->addShaderProfile( "vp20" );
+        mRealCapabilities->addShaderProfile( "vp30" );
+        mRealCapabilities->addShaderProfile( "vp40" );
+        mRealCapabilities->addShaderProfile( "ps_1_1" );
+        mRealCapabilities->addShaderProfile( "ps_1_2" );
+        mRealCapabilities->addShaderProfile( "ps_1_3" );
+        mRealCapabilities->addShaderProfile( "ps_1_4" );
+        mRealCapabilities->addShaderProfile( "ps_2_0" );
+        mRealCapabilities->addShaderProfile( "ps_2_x" );
+        mRealCapabilities->addShaderProfile( "ps_3_0" );
+        mRealCapabilities->addShaderProfile( "ps_3_x" );
+        mRealCapabilities->addShaderProfile( "arbfp1" );
+        mRealCapabilities->addShaderProfile( "fp20" );
+        mRealCapabilities->addShaderProfile( "fp30" );
+        mRealCapabilities->addShaderProfile( "fp40" );
+        mRealCapabilities->addShaderProfile( "gpu_gp" );
+    	mRealCapabilities->addShaderProfile( "gp4_gp" );
+
 
 		return mRealCapabilities;
 	}

NullRendererDll.cpp

 #include "NullRenderSystem.h"
 #include "NullHlslProgramFactory.h"
 
+#ifndef OGRE_STATIC_LIB
+
 namespace Ogre {
 
 	NULLRenderSystem* nullRendPlugin;
 	NULLHLSLProgramFactory* hlslProgramFactory;
+	NULLGpuProgramManager*  manager;
 
-	extern "C" void dllStartPlugin(void) throw()
+	extern "C" void _OgreNULLRSExport dllStartPlugin(void) throw()
 	{
 		nullRendPlugin = new NULLRenderSystem();
 		Ogre::Root::getSingleton().addRenderSystem( (Ogre::RenderSystem *)nullRendPlugin );
         // create & register HLSL factory
         hlslProgramFactory = new NULLHLSLProgramFactory();
 		Ogre::HighLevelGpuProgramManager::getSingleton().addFactory(hlslProgramFactory);
+
+		manager = new NULLGpuProgramManager();
 	}
 
-	extern "C" void dllStopPlugin(void)
+	extern "C" void _OgreNULLRSExport dllStopPlugin(void)
 	{
+		delete manager;
 		delete nullRendPlugin;
 		delete hlslProgramFactory;
 	}
 
 }
+
+#endif
+
 #include <OgreResourceManager.h>
 #include <OgreRenderSystemCapabilities.h>
 #include "OgreGpuProgramManager.h"
+
+
+#if (OGRE_PLATFORM == OGRE_PLATFORM_WIN32) && !defined(OGRE_STATIC_LIB)
+#	ifdef OGRENULLRSDLL_EXPORTS
+#		define _OgreNULLRSExport __declspec(dllexport)
+#	else
+#       if defined( __MINGW32__ )
+#           define _OgreNULLRSExport
+#       else
+#    		define _OgreNULLRSExport __declspec(dllimport)
+#       endif
+#	endif
+#else
+#	define _OgreNULLRSExport 
+#endif	// OGRE_WIN32
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.