예제 #1
0
		public override void Shutdown()
		{
			//Deleting the GLSL program factory
			if ( this.glslESProgramFactory != null )
			{
				//Remove from manager safely
				if ( HighLevelGpuProgramManager.Instance != null )
				{
					HighLevelGpuProgramManager.Instance.RemoveFactory( this.glslESProgramFactory );
				}
				this.glslESProgramFactory.Dispose();
				this.glslESProgramFactory = null;
			}
			//Deleting the GLSL program factory
			if ( this.glslESCgProgramFactory != null )
			{
				if ( HighLevelGpuProgramManager.Instance != null )
				{
					HighLevelGpuProgramManager.Instance.RemoveFactory( this.glslESCgProgramFactory );
				}
				this.glslESCgProgramFactory.Dispose();
				this.glslESCgProgramFactory = null;
			}

			//Deleting the GPU program manager and hardware buffer manager. Has to be done before the glSupport.Stop()
			if ( null != this.gpuProgramManager )
			{
				this.gpuProgramManager.Dispose();
				this.gpuProgramManager = null;
			}

			this.hardwareBufferManager = null;

			this.rttManager = null;

			if ( null != this.textureManager ) 
			{
				textureManager.Dispose();
				textureManager = null;
			}

			base.Shutdown();

			this.glSupport.Stop();

			this.glInitialized = false;
		}
예제 #2
0
		public override void InitializeFromRenderSystemCapabilities( RenderSystemCapabilities caps, RenderTarget primary )
		{
			if ( caps.RendersystemName != this.Name )
			{
				throw new AxiomException( "Trying to initialize GLES2RenderSystem from RenderSystemCapabilities that do not support OpenGL ES" );
			}

			this.gpuProgramManager = new GLES2GpuProgramManager();
			this.glslESProgramFactory = new GLSLES.GLSLESProgramFactory();
			HighLevelGpuProgramManager.Instance.AddFactory( this.glslESProgramFactory );

			//todo: check what can/can't support cg
			this.glslESCgProgramFactory = new GLSLES.GLSLESCgProgramFactory();
			HighLevelGpuProgramManager.Instance.AddFactory( this.glslESCgProgramFactory );

			//Set texture the number of texture units
			this.fixedFunctionTextureUnits = caps.TextureUnitCount;

			//Use VBO's by default
			this.hardwareBufferManager = new GLES2HardwareBufferManager();

			//Create FBO manager
			LogManager.Instance.Write( "GL ES 2: Using FBOs for rendering to textures" );
			this.rttManager = new GLES2FBOManager();
			caps.SetCapability( Graphics.Capabilities.RTTSerperateDepthBuffer );

			Log defaultLog = LogManager.Instance.DefaultLog;
			if ( defaultLog != null )
			{
				caps.Log( defaultLog );
			}

			textureManager = new GLES2TextureManager( this.glSupport );

			this.glInitialized = true;
		}