Marko Pintera 11 rokov pred
rodič
commit
935089a4c8

+ 6 - 11
CamelotCore/CamelotCore.vcxproj

@@ -150,7 +150,7 @@
     <Link>
       <SubSystem>NotSet</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
-      <AdditionalDependencies>CamelotUtility.lib;cg.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>CamelotUtility.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <AdditionalLibraryDirectories>../lib/x86/$(Configuration);../Dependencies/lib/x86/Debug</AdditionalLibraryDirectories>
       <ImportLibrary>..\lib\x86\$(Configuration)\$(TargetName).lib</ImportLibrary>
     </Link>
@@ -168,7 +168,7 @@
     <Link>
       <SubSystem>NotSet</SubSystem>
       <GenerateDebugInformation>true</GenerateDebugInformation>
-      <AdditionalDependencies>CamelotUtility.lib;cg.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>CamelotUtility.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <AdditionalLibraryDirectories>../lib/$(Platform)/$(Configuration);../Dependencies/lib/x64/Debug</AdditionalLibraryDirectories>
       <ImportLibrary>..\lib\$(Platform)\$(Configuration)\$(TargetName).lib</ImportLibrary>
     </Link>
@@ -192,7 +192,7 @@
       <GenerateDebugInformation>false</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
-      <AdditionalDependencies>CamelotUtility.lib;cg.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>CamelotUtility.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <AdditionalLibraryDirectories>../lib/x86/$(Configuration);../Dependencies/lib/x86/Release</AdditionalLibraryDirectories>
       <ImportLibrary>..\lib\x86\$(Configuration)\$(TargetName).lib</ImportLibrary>
     </Link>
@@ -217,7 +217,7 @@
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
-      <AdditionalDependencies>CamelotUtility.lib;cg.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>CamelotUtility.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <AdditionalLibraryDirectories>../lib/x86/$(Configuration);../Dependencies/lib/x86/DebugRelease</AdditionalLibraryDirectories>
       <ImportLibrary>..\lib\x86\$(Configuration)\$(TargetName).lib</ImportLibrary>
     </Link>
@@ -241,7 +241,7 @@
       <GenerateDebugInformation>false</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
-      <AdditionalDependencies>CamelotUtility.lib;cg.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>CamelotUtility.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <AdditionalLibraryDirectories>../lib/$(Platform)/$(Configuration);../Dependencies/lib/x64/Release</AdditionalLibraryDirectories>
       <ImportLibrary>..\lib\$(Platform)\$(Configuration)\$(TargetName).lib</ImportLibrary>
     </Link>
@@ -266,7 +266,7 @@
       <GenerateDebugInformation>true</GenerateDebugInformation>
       <EnableCOMDATFolding>true</EnableCOMDATFolding>
       <OptimizeReferences>true</OptimizeReferences>
-      <AdditionalDependencies>CamelotUtility.lib;cg.lib;%(AdditionalDependencies)</AdditionalDependencies>
+      <AdditionalDependencies>CamelotUtility.lib;%(AdditionalDependencies)</AdditionalDependencies>
       <AdditionalLibraryDirectories>../lib/$(Platform)/$(Configuration);../Dependencies/lib/x64/DebugRelease</AdditionalLibraryDirectories>
       <ImportLibrary>..\lib\$(Platform)\$(Configuration)\$(TargetName).lib</ImportLibrary>
     </Link>
@@ -313,9 +313,6 @@
     <ClInclude Include="Include\CmMemAllocCategories.h" />
     <ClInclude Include="Include\CmApplication.h" />
     <ClInclude Include="Include\CmBlendStateRTTI.h" />
-    <ClInclude Include="Include\CmCgProgram.h" />
-    <ClInclude Include="Include\CmCgProgramFactory.h" />
-    <ClInclude Include="Include\CmCgProgramRTTI.h" />
     <ClInclude Include="Include\CmCommandQueue.h" />
     <ClInclude Include="Include\CmCommonEnums.h" />
     <ClInclude Include="Include\CmComponentRTTI.h" />
@@ -436,8 +433,6 @@
     <ClCompile Include="Source\CmGameObject.cpp" />
     <ClCompile Include="Source\CmApplication.cpp" />
     <ClCompile Include="Source\CmBlendState.cpp" />
-    <ClCompile Include="Source\CmCgProgram.cpp" />
-    <ClCompile Include="Source\CmCgProgramFactory.cpp" />
     <ClCompile Include="Source\CmCommandQueue.cpp" />
     <ClCompile Include="Source\CmCoreObject.cpp" />
     <ClCompile Include="Source\CmCoreObjectManager.cpp" />

+ 0 - 21
CamelotCore/CamelotCore.vcxproj.filters

@@ -37,12 +37,6 @@
     <Filter Include="Source Files\Resources">
       <UniqueIdentifier>{6df1cc13-bf9e-45e7-90ae-337999c702cf}</UniqueIdentifier>
     </Filter>
-    <Filter Include="Header Files\Cg">
-      <UniqueIdentifier>{7477862a-2ebf-43ed-adb9-725c453b0b50}</UniqueIdentifier>
-    </Filter>
-    <Filter Include="Source Files\Cg">
-      <UniqueIdentifier>{eeb7d0ea-f842-4f3c-b462-135af2eff493}</UniqueIdentifier>
-    </Filter>
     <Filter Include="Header Files\Scene">
       <UniqueIdentifier>{327fbccb-fd0d-4fb1-af08-5d00cd7d56a7}</UniqueIdentifier>
     </Filter>
@@ -168,12 +162,6 @@
     <ClInclude Include="Include\CmResources.h">
       <Filter>Header Files\Resources</Filter>
     </ClInclude>
-    <ClInclude Include="Include\CmCgProgram.h">
-      <Filter>Header Files\Cg</Filter>
-    </ClInclude>
-    <ClInclude Include="Include\CmCgProgramFactory.h">
-      <Filter>Header Files\Cg</Filter>
-    </ClInclude>
     <ClInclude Include="Include\CmComponent.h">
       <Filter>Header Files\Scene</Filter>
     </ClInclude>
@@ -234,9 +222,6 @@
     <ClInclude Include="Include\CmRendererManager.h">
       <Filter>Header Files\Renderer</Filter>
     </ClInclude>
-    <ClInclude Include="Include\CmCgProgramRTTI.h">
-      <Filter>Header Files\RTTI</Filter>
-    </ClInclude>
     <ClInclude Include="Include\CmPassRTTI.h">
       <Filter>Header Files\RTTI</Filter>
     </ClInclude>
@@ -602,12 +587,6 @@
     <ClCompile Include="Source\CmResource.cpp">
       <Filter>Source Files\Resources</Filter>
     </ClCompile>
-    <ClCompile Include="Source\CmCgProgram.cpp">
-      <Filter>Source Files\Cg</Filter>
-    </ClCompile>
-    <ClCompile Include="Source\CmCgProgramFactory.cpp">
-      <Filter>Source Files\Cg</Filter>
-    </ClCompile>
     <ClCompile Include="Source\CmComponent.cpp">
       <Filter>Source Files\Scene</Filter>
     </ClCompile>

+ 0 - 111
CamelotCore/Include/CmCgProgram.h

@@ -1,111 +0,0 @@
-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-(Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2011 Torus Knot Software Ltd
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-#ifndef __CgProgram_H__
-#define __CgProgram_H__
-
-#include "CmPrerequisites.h"
-#include <Cg/cg.h>
-#include "CmHighLevelGpuProgram.h"
-
-namespace BansheeEngine {
-    /** Specialisation of HighLevelGpuProgram to provide support for nVidia's CG language.
-    @remarks
-        In its current state Cg only acts as a translator and internally creates either a HLSL
-		or a GLSL object. Cg doesn't support SM5 for GLSL (only Nvidia cards are supported,
-		which makes it very much useless for majority of projects).
-    */
-    class CM_EXPORT CgProgram : public HighLevelGpuProgram
-    {
-    public:
-        ~CgProgram();
-
-        /** Gets the entry point defined for this program. */
-        const String& getEntryPoint(void) const { return mEntryPoint; }
-        /// Overridden from GpuProgram
-        bool isSupported(void) const;
-        /// Overridden from GpuProgram
-        const String& getLanguage(void) const;
-
-		/**
-		 * @copydoc HighLevelGpuProgram::getBindingDelegate().
-		 */
-		GpuProgramPtr getBindingDelegate();
-
-		/**
-		 * @copydoc HighLevelGpuProgram::createParameters().
-		 */
-		GpuParamsPtr createParameters();
-
-    protected:
-		friend class CgProgramFactory;
-
-        /// The CG context to use, passed in by factory
-        CGcontext mCgContext;
-        /// Program handle
-        CGprogram mCgProgram;
-		String mSelectedProfile;
-		CGprofile mSelectedCgProfile;
-
-		CgProgram(CGcontext context, const String& source, const String& entryPoint, const String& language, 
-			GpuProgramType gptype, GpuProgramProfile profile, const Vector<HGpuProgInclude>::type* includes, 
-			bool isAdjacencyInfoRequired = false);
-
-        /** Internal load implementation, must be implemented by subclasses.
-        */
-        void loadFromSource(void);
-		/**
-		 * @copydoc GpuProgram::unload_internal()
-		 */
-        void unload_internal(void);
-
-		/**
-		 * @brief	Cg acts only like a wrapper to a rendersystem specific program.
-		 * 			This returns the actual program we are wrapping.
-		 */
-		HighLevelGpuProgramPtr getWrappedProgram() const;
-
-        /// Internal method which works out which profile to use for this program
-        void selectProfile(void);
-
-		/************************************************************************/
-		/* 								SERIALIZATION                      		*/
-		/************************************************************************/
-	public:
-		friend class CgProgramRTTI;
-		static RTTITypeBase* getRTTIStatic();
-		virtual RTTITypeBase* getRTTI() const;
-    };
-
-	/** Utility function, checks Cg for errors, throw exception if detected.
-    @param ogreMethod Ogre method name, as Class::method
-    @param errorTextPrefix The text to prefix the Cg error text with
-    */
-    void checkForCgError(const String& ogreMethod, const String& errorTextPrefix, CGcontext context);
-}
-
-#endif

+ 0 - 54
CamelotCore/Include/CmCgProgramFactory.h

@@ -1,54 +0,0 @@
-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-(Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2011 Torus Knot Software Ltd
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-#ifndef __CgProgramFactory_H__
-#define __CgProgramFactory_H__
-
-#include "CmPrerequisites.h"
-#include <Cg/cg.h>
-#include "CmHighLevelGpuProgramManager.h"
-
-namespace BansheeEngine
-{
-    /** Factory class for Cg programs. */
-    class CM_EXPORT CgProgramFactory : public HighLevelGpuProgramFactory
-    {
-    protected:
-        CGcontext mCgContext;
-		static String sLanguageName;
-    public:
-        CgProgramFactory();
-        ~CgProgramFactory();
-		/// Get the name of the language this factory creates programs for
-		const String& getLanguage(void) const;
-        HighLevelGpuProgramPtr create(const String& source, const String& entryPoint, GpuProgramType gptype, 
-			GpuProgramProfile profile, const Vector<HGpuProgInclude>::type* includes = nullptr);
-		HighLevelGpuProgramPtr create();
-    };
-}
-
-#endif

+ 0 - 33
CamelotCore/Include/CmCgProgramRTTI.h

@@ -1,33 +0,0 @@
-#pragma once
-
-#include "CmPrerequisites.h"
-#include "CmRTTIType.h"
-#include "CmHighLevelGpuProgramManager.h"
-#include "CmHighLevelGpuProgram.h"
-#include "CmCgProgram.h"
-
-namespace BansheeEngine
-{
-	class CM_EXPORT CgProgramRTTI : public RTTIType<CgProgram, HighLevelGpuProgram, CgProgramRTTI>
-	{
-	public:
-		CgProgramRTTI()
-		{ }
-
-		virtual const String& getRTTIName()
-		{
-			static String name = "CgProgram";
-			return name;
-		}
-
-		virtual UINT32 getRTTIId()
-		{
-			return TID_CgProgram;
-		}
-
-		virtual std::shared_ptr<IReflectable> newRTTIObject()
-		{
-			return HighLevelGpuProgramManager::instance().createEmpty("cg");
-		}
-	};
-}

+ 0 - 186
CamelotCore/Source/CmCgProgram.cpp

@@ -1,186 +0,0 @@
-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-(Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2011 Torus Knot Software Ltd
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-#include "CmCgProgram.h"
-#include "CmGpuProgramManager.h"
-#include "CmHighLevelGpuProgramManager.h"
-#include "CmRenderSystem.h"
-#include "CmDebug.h"
-#include "CmException.h"
-#include "CmCgProgramRTTI.h"
-
-namespace BansheeEngine {
-
-	void checkForCgError(const String& ogreMethod, const String& errorTextPrefix, CGcontext context)
-	{
-		CGerror error = cgGetError();
-		if (error != CG_NO_ERROR)
-		{
-			String msg = errorTextPrefix + cgGetErrorString(error); 
-
-			if (error == CG_COMPILER_ERROR)
-			{
-				// Get listing with full compile errors
-				msg = msg + "\n" + cgGetLastListing(context);
-			}
-
-			CM_EXCEPT(InternalErrorException, msg);
-		}
-	}
-    //-----------------------------------------------------------------------
-    void CgProgram::selectProfile(void)
-    {
-        mSelectedProfile.clear();
-        mSelectedCgProfile = CG_PROFILE_UNKNOWN;
-
-		RenderSystem* rs = RenderSystem::instancePtr();
-		const String& rsName = rs->getName();
-
-		mSelectedProfile = GpuProgramManager::instance().gpuProgProfileToRSSpecificProfile(mProfile);
-		GpuProgramManager& gpuMgr = GpuProgramManager::instance();
-		if (gpuMgr.isSyntaxSupported(mSelectedProfile))
-		{
-			mSelectedCgProfile = cgGetProfile(mSelectedProfile.c_str());
-			// Check for errors
-			checkForCgError("CgProgram::selectProfile", 
-				"Unable to find CG profile enum for program.", mCgContext);
-		}
-		else
-			mSelectedProfile.clear();
-    }
-    //-----------------------------------------------------------------------
-    void CgProgram::loadFromSource(void)
-    {
-        // Create Cg Program
-        selectProfile();
-		if (mSelectedCgProfile == CG_PROFILE_UNKNOWN)
-		{
-			LOGWRN("Attempted to load Cg program but no supported profile was found.");
-			return;
-		}
-
-		// TODO PORT - This doesn't load includes
-		// deal with includes
-		String sourceToUse = mSource;
-		//String sourceToUse = resolveCgIncludes(mSource, this, mFilename);
-        mCgProgram = cgCreateProgram(mCgContext, CG_SOURCE, sourceToUse.c_str(), 
-            mSelectedCgProfile, mEntryPoint.c_str(), nullptr);
-
-        // Check for errors
-        checkForCgError("CgProgram::loadFromSource", 
-            "Unable to compile Cg program", mCgContext);
-
-		// ignore any previous error
-		if (mSelectedCgProfile != CG_PROFILE_UNKNOWN)
-		{
-			String sourceFromCg = cgGetProgramString(mCgProgram, CG_COMPILED_PROGRAM);
-
-			// Create a low-level program, give it the same name as us
-			mAssemblerProgram = 
-				HighLevelGpuProgramManager::instance().create(
-				sourceFromCg, mEntryPoint, RenderSystem::instance().getShadingLanguageName(), mType, mProfile, nullptr);
-
-			// Shader params need to be forwarded to low level implementation
-			mAssemblerProgram->setAdjacencyInfoRequired(isAdjacencyInfoRequired());
-		}
-
-		cgDestroyProgram(mCgProgram);
-		checkForCgError("CgProgram::unloadImpl", "Error while unloading Cg program", mCgContext);
-		mCgProgram = nullptr;
-    }
-
-    void CgProgram::unload_internal(void)
-    {
-		HighLevelGpuProgram::destroy_internal();
-    }
-
-	GpuParamsPtr CgProgram::createParameters()
-	{
-		return getWrappedProgram()->createParameters();
-	}
-
-	GpuProgramPtr CgProgram::getBindingDelegate(void)
-	{
-		if(mAssemblerProgram)
-			return getWrappedProgram()->getBindingDelegate();
-
-		return nullptr;
-	}
-
-	HighLevelGpuProgramPtr CgProgram::getWrappedProgram() const
-	{
-		HighLevelGpuProgramPtr wrappedProgram = std::static_pointer_cast<HighLevelGpuProgram>(mAssemblerProgram);
-
-		return wrappedProgram;
-	}
-
-	CgProgram::CgProgram(CGcontext context, const String& source, const String& entryPoint, const String& language, 
-		GpuProgramType gptype, GpuProgramProfile profile, const Vector<HGpuProgInclude>::type* includes, bool isAdjacencyInfoRequired)
-        : HighLevelGpuProgram(source, entryPoint, language, gptype, profile, includes, isAdjacencyInfoRequired), 
-        mCgContext(context), mCgProgram(0), 
-        mSelectedCgProfile(CG_PROFILE_UNKNOWN)
-    {
-
-    }
-
-    CgProgram::~CgProgram()
-    {
-        unload_internal();
-    }
-
-    bool CgProgram::isSupported(void) const
-    {
-        if (!isRequiredCapabilitiesSupported())
-            return false;
-
-		String selectedProfile = GpuProgramManager::instance().gpuProgProfileToRSSpecificProfile(mProfile);
-		if (GpuProgramManager::instance().isSyntaxSupported(selectedProfile))
-			return true;
-
-        return false;
-    }
-
-    const String& CgProgram::getLanguage(void) const
-    {
-        static const String language = "cg";
-
-        return language;
-    }
-
-	/************************************************************************/
-	/* 								SERIALIZATION                      		*/
-	/************************************************************************/
-	RTTITypeBase* CgProgram::getRTTIStatic()
-	{
-		return CgProgramRTTI::instance();
-	}
-
-	RTTITypeBase* CgProgram::getRTTI() const
-	{
-		return CgProgram::getRTTIStatic();
-	}
-}

+ 0 - 72
CamelotCore/Source/CmCgProgramFactory.cpp

@@ -1,72 +0,0 @@
-/*
------------------------------------------------------------------------------
-This source file is part of OGRE
-(Object-oriented Graphics Rendering Engine)
-For the latest info, see http://www.ogre3d.org/
-
-Copyright (c) 2000-2011 Torus Knot Software Ltd
-
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to deal
-in the Software without restriction, including without limitation the rights
-to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
-copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
-THE SOFTWARE.
------------------------------------------------------------------------------
-*/
-
-#include "CmCgProgramFactory.h"
-#include "CmCgProgram.h"
-
-namespace BansheeEngine {
-    //-----------------------------------------------------------------------
-    String CgProgramFactory::sLanguageName = "cg";
-    //-----------------------------------------------------------------------
-    CgProgramFactory::CgProgramFactory()
-    {
-        mCgContext = cgCreateContext();
-        // Check for errors
-        checkForCgError("CgProgramFactory::CgProgramFactory", 
-            "Unable to create initial Cg context: ", mCgContext);
-    }
-    //-----------------------------------------------------------------------
-    CgProgramFactory::~CgProgramFactory()
-    {
-        cgDestroyContext(mCgContext);
-        // Check for errors
-        checkForCgError("CgProgramFactory::~CgProgramFactory", 
-            "Unable to destroy Cg context: ", mCgContext);
-    }
-    //-----------------------------------------------------------------------
-    const String& CgProgramFactory::getLanguage(void) const
-    {
-        return sLanguageName;
-    }
-    //-----------------------------------------------------------------------
-    HighLevelGpuProgramPtr CgProgramFactory::create(const String& source, const String& entryPoint, 
-		GpuProgramType gptype, GpuProgramProfile profile, const Vector<HGpuProgInclude>::type* includes)
-    {
-		CgProgram* prog = new (cm_alloc<CgProgram, PoolAlloc>()) CgProgram(mCgContext, source, entryPoint, sLanguageName, gptype, profile, includes);
-
-		return cm_core_ptr<CgProgram, PoolAlloc>(prog);
-    }
-	//----------------------------------------------------------------------
-	HighLevelGpuProgramPtr CgProgramFactory::create()
-	{
-		CgProgram* prog = new (cm_alloc<CgProgram, PoolAlloc>()) CgProgram(mCgContext, "", "", sLanguageName, GPT_VERTEX_PROGRAM, GPP_NONE, nullptr);
-
-		return cm_core_ptr<CgProgram, PoolAlloc>(prog);
-	}
-    //-----------------------------------------------------------------------
-}

+ 0 - 2
CamelotD3D9Renderer/Include/CmD3D9RenderSystem.h

@@ -33,7 +33,6 @@ THE SOFTWARE.
 #include "CmRenderSystem.h"
 #include "CmRenderSystemCapabilities.h"
 #include "CmD3D9Mappings.h"
-#include "CmCgProgramFactory.h"
 
 namespace BansheeEngine 
 {
@@ -240,7 +239,6 @@ namespace BansheeEngine
 		bool _checkMultiSampleQuality(D3DMULTISAMPLE_TYPE type, DWORD *outQuality, D3DFORMAT format, UINT adapterNum, D3DDEVTYPE deviceType, BOOL fullScreen);
 		
         D3D9HLSLProgramFactory* mHLSLProgramFactory;
-		CgProgramFactory* mCgProgramFactory;
 		D3D9ResourceManager* mResourceManager;
 		D3D9DeviceManager* mDeviceManager;
 

+ 0 - 14
CamelotD3D9Renderer/Source/CmD3D9RenderSystem.cpp

@@ -95,7 +95,6 @@ namespace BansheeEngine
 		mActiveD3DDriver = NULL;	
 		mUseNVPerfHUD = false;
 		mHLSLProgramFactory = NULL;		
-		mCgProgramFactory = NULL;
 		mDeviceManager = NULL;	
 		mResourceManager = nullptr;	
 
@@ -159,9 +158,6 @@ namespace BansheeEngine
 		// Create & register HLSL factory		
 		mHLSLProgramFactory = cm_new<D3D9HLSLProgramFactory>();
 
-		// Create & register Cg factory		
-		mCgProgramFactory = cm_new<CgProgramFactory>();
-
 		// Create render window manager
 		RenderWindowManager::startUp(cm_new<D3D9RenderWindowManager>(this));
 
@@ -222,13 +218,6 @@ namespace BansheeEngine
 			mHLSLProgramFactory = 0;
 		}
 
-		if(mCgProgramFactory)
-		{
-			HighLevelGpuProgramManager::instance().removeFactory(mCgProgramFactory);
-			cm_delete(mCgProgramFactory);
-			mCgProgramFactory = 0;
-		}
-
 		SAFE_RELEASE( mpD3D );
 
 		if(mResourceManager != nullptr)
@@ -2260,9 +2249,6 @@ namespace BansheeEngine
 		if (caps->isShaderProfileSupported("hlsl"))
 			HighLevelGpuProgramManager::instance().addFactory(mHLSLProgramFactory);
 
-		if (caps->isShaderProfileSupported("cg"))
-			HighLevelGpuProgramManager::instance().addFactory(mCgProgramFactory);
-
 		mNumTexStages = caps->getNumCombinedTextureUnits();
 		mTexStageDesc = cm_newN<sD3DTextureStageDesc>(mNumTexStages);
 

+ 0 - 2
CamelotGLRenderer/Include/CmGLRenderSystem.h

@@ -33,7 +33,6 @@ THE SOFTWARE.
 #include "CmGLHardwareBufferManager.h"
 #include "CmGLGpuProgramManager.h"
 #include "CmGLSLProgramFactory.h"
-#include "CmCgProgramFactory.h"
 #include "CmVector4.h"
 
 namespace BansheeEngine {
@@ -259,7 +258,6 @@ namespace BansheeEngine {
         bool mGLInitialised;
 
 		GLSLProgramFactory* mGLSLProgramFactory;
-		CgProgramFactory* mCgProgramFactory;
 		GLSLProgramPipelineManager* mProgramPipelineManager;
 
         GLuint getCombinedMinMipFilter(void) const;

+ 0 - 17
CamelotGLRenderer/Source/CmGLRenderSystem.cpp

@@ -71,7 +71,6 @@ namespace BansheeEngine
 	GLRenderSystem::GLRenderSystem()
 		: mDepthWrite(true),
 		mGLSLProgramFactory(nullptr),
-		mCgProgramFactory(nullptr),
 		mProgramPipelineManager(nullptr),
 		mActivePipeline(nullptr),
 		mActiveTextureUnit(0),
@@ -196,15 +195,6 @@ namespace BansheeEngine
 			mGLSLProgramFactory = nullptr;
 		}
 
-		// Deleting Cg GLSL program factory
-		if (mCgProgramFactory)
-		{
-			// Remove from manager safely
-			HighLevelGpuProgramManager::instance().removeFactory(mCgProgramFactory);
-			cm_delete(mCgProgramFactory);
-			mCgProgramFactory = nullptr;
-		}
-
 		// Deleting the GPU program manager and hardware buffer manager.  Has to be done before the mGLSupport->stop().
 		GpuProgramManager::shutDown();
 		HardwareBufferManager::shutDown();
@@ -1814,13 +1804,6 @@ namespace BansheeEngine
 			checkForErrors();
 		}
 
-		if(caps->isShaderProfileSupported("cg"))
-		{
-			mCgProgramFactory = cm_new<CgProgramFactory>();
-			HighLevelGpuProgramManager::instance().addFactory(mCgProgramFactory);
-			checkForErrors();
-		}
-
 		if(caps->hasCapability(RSC_HWOCCLUSION))
 		{
 			if(caps->hasCapability(RSC_GL1_5_NOHWOCCLUSION))