Inheritance: Axiom.Graphics.GpuProgramManager
Beispiel #1
0
		/// <summary>
		///
		/// </summary>
		/// <param name="primary"></param>
		protected void InitializeContext( RenderTarget primary )
		{
			// Set main and current context
			_mainContext = (GLESContext)primary[ "GLCONTEXT" ];
			LogManager.Instance.Write( _mainContext == null ? "maincontext NULL" : "maincontext NOT NULL" );
			_currentContext = _mainContext;

			// Set primary context as active
			if ( _currentContext != null )
				_currentContext.SetCurrent();

			// intialize GL extensions and check capabilites
			_glSupport.InitializeExtensions();

			LogManager.Instance.Write( "***************************" );
			LogManager.Instance.Write( "*** GLES Renderer Started ***" );
			LogManager.Instance.Write( "***************************" );

			// log hardware info
			LogManager.Instance.Write( "Vendor: {0}", _glSupport.Vendor );
			LogManager.Instance.Write( "Video Board: {0}", _glSupport.VideoCard );
			LogManager.Instance.Write( "Version: {0}", _glSupport.Version );

			LogManager.Instance.Write( "Extensions supported: " );

			foreach ( string ext in _glSupport.Extensions )
			{
				LogManager.Instance.Write( ext );
			}

			// create our special program manager
			this._gpuProgramManager = new GLESGpuProgramManager();

			// query hardware capabilites
			CheckCaps( primary );

			// create a specialized instance, which registers itself as the singleton instance of HardwareBufferManager
			// use software buffers as a fallback, which operate as regular vertex arrays
			if ( this._rsCapabilities.HasCapability( Capabilities.VertexBuffer ) )
			{
				hardwareBufferManager = new GLESHardwareBufferManager();
			}
			else
			{
				hardwareBufferManager = new GLESDefaultHardwareBufferManager();
			}

			// by creating our texture manager, singleton TextureManager will hold our implementation
			textureManager = new GLESTextureManager( _glSupport );
			_polygonMode = GLFill;
			this._glInitialized = true;
		}
Beispiel #2
0
		/// <summary>
		/// 
		/// </summary>
		public override void Shutdown()
		{
			base.Shutdown();

			_gpuProgramManager.Dispose();
			_gpuProgramManager = null;

			hardwareBufferManager.Dispose();
			hardwareBufferManager = null;

			//_rttManager.Dispose();
			_rttManager = null;

			_glSupport.Stop();

			textureManager.Dispose();
			textureManager = null;

			_glInitialized = false;
		}