Class that encapsulates an GL context. (IE a window/pbuffer). This is a virtual base class which should be implemented in a GLES2Support. This object can also be used to cache renderstate if we decide to do so in the future.
Пример #1
0
 public void GLESRTTManager(GLESSupport support, RenderTarget mainWindow)
 {
     this._support     = support;
     this._mainWindow  = mainWindow;
     this._mainContext = (GLESContext)this._mainWindow["glcontext"];
 }
Пример #2
0
		public void GLESRTTManager( GLESSupport support, RenderTarget mainWindow )
		{
			_support = support;
			_mainWindow = mainWindow;
			_mainContext = (GLESContext)_mainWindow[ "glcontext" ];
		}
Пример #3
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;
		}
Пример #4
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="context"></param>
		public void UnregisterContext( GLESContext context )
		{
			throw new NotImplementedException();
		}
Пример #5
0
		/// <summary>
		/// Default ctor.
		/// </summary>
		public GLESRenderSystem()
		{
			depthWrite = true;
			_stencilMask = 0xFFFFFFFF;
			int i;

			LogManager.Instance.Write( string.Format( "{0} created.", Name ) );

			_glSupport = GLESUtil.GLESSupport;

			for ( i = 0; i < MaxLights; i++ )
				_lights[ i ] = null;

			_worldMatrix = Matrix4.Identity;
			_ViewMatrix = Matrix4.Identity;

			_glSupport.AddConfig();

			_colorWrite[ 0 ] = _colorWrite[ 1 ] = _colorWrite[ 2 ] = _colorWrite[ 3 ] = true;

			for ( int layer = 0; layer < Axiom.Configuration.Config.MaxTextureLayers; layer++ )
			{
				// Dummy value
				_textureCoodIndex[ layer ] = 99;
			}

			_textureCount = 0;
			activeRenderTarget = null;
			_currentContext = null;
			_mainContext = null;
			_glInitialized = false;
			numCurrentLights = 0;
			_textureMipmapCount = 0;
			_minFilter = FilterOptions.Linear;
			_mipFilter = FilterOptions.Point;
			// _polygonMode = OpenTK.Graphics.ES11.
		}
Пример #6
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="context"></param>
		private void SwitchContext( GLESContext context )
		{
		}