Texture surface
Inheritance: GLESHardwarePixelBuffer
Example #1
0
        /// <summary>
        /// </summary>
        /// <param name="src"> </param>
        /// <param name="srcBox"> </param>
        /// <param name="dstBox"> </param>
        public void BlitFromTexture(GLESTextureBuffer src, BasicBox srcBox, BasicBox dstBox)
        {
            if (!Root.Instance.RenderSystem.HardwareCapabilities.HasCapability(Capabilities.FrameBufferObjects))
            {
                // the following code depends on FBO support, it crashes if FBO is not supported.
                // TODO - write PBUFFER version of this function or a version that doesn't require FBO
                return;
            }

            /// Store reference to FBO manager
            throw new NotImplementedException();
        }
Example #2
0
        /// <summary>
        /// </summary>
        protected void CreateSurfaceList()
        {
            this._surfaceList.Clear();
            // For all faces and mipmaps, store surfaces as HardwarePixelBufferSharedPtr
            bool wantGenerateMips = (Usage & TextureUsage.AutoMipMap) == TextureUsage.AutoMipMap;
            // Do mipmapping in software? (uses GLU) For some cards, this is still needed. Of course,
            // only when mipmap generation is desired.
            bool doSoftware = wantGenerateMips && !MipmapsHardwareGenerated && MipmapCount > 0;

            for (int face = 0; face < faceCount; face++)
            {
                int width  = Width;
                int height = Height;
                for (int mip = 0; mip <= MipmapCount; mip++)
                {
                    HardwarePixelBuffer buf = new GLESTextureBuffer(Name, GLESTextureTarget, this._textureID, width, height, (int)GLESPixelUtil.GetClosestGLInternalFormat(Format, HardwareGammaEnabled), face, mip, (BufferUsage)Usage, doSoftware && mip == 0, HardwareGammaEnabled, FSAA);

                    this._surfaceList.Add(buf);

                    // If format is PVRTC then every mipmap is a custom one so to allow the upload of the compressed data
                    // provided by the file we need to adjust the current mip level's dimention
#warning Compressed Textures are not yet supported by axiom

                    /*
                     * if (mFormat == PF_PVRTC_RGB2 || mFormat == PF_PVRTC_RGBA2 ||
                     * mFormat == PF_PVRTC_RGB4 || mFormat == PF_PVRTC_RGBA4)
                     * {
                     *      if (width > 1)
                     *      {
                     *              width = width / 2;
                     *      }
                     *      if (height > 1)
                     *      {
                     *              height = height / 2;
                     *      }
                     * }*/
                    /// Check for error
                    if (buf.Width == 0 || buf.Height == 0 || buf.Depth == 0)
                    {
                        throw new AxiomException(string.Format("Zero sized texture surface on texture: {0} face: {1} mipmap : {2}. The GL driver probably refused to create the texture.", Name, face, mip));
                    }
                }
            }
        }
Example #3
0
		/// <summary>
		/// 
		/// </summary>
		protected void CreateSurfaceList()
		{
			_surfaceList.Clear();
			// For all faces and mipmaps, store surfaces as HardwarePixelBufferSharedPtr
			bool wantGenerateMips = ( Usage & TextureUsage.AutoMipMap ) == TextureUsage.AutoMipMap;
			// Do mipmapping in software? (uses GLU) For some cards, this is still needed. Of course,
			// only when mipmap generation is desired.
			bool doSoftware = wantGenerateMips && !MipmapsHardwareGenerated && MipmapCount > 0;

			for ( int face = 0; face < faceCount; face++ )
			{
				int width = Width;
				int height = Height;
				for ( int mip = 0; mip <= MipmapCount; mip++ )
				{
					HardwarePixelBuffer buf = new GLESTextureBuffer( Name, GLESTextureTarget, _textureID, width, height, (int)GLESPixelUtil.GetClosestGLInternalFormat( Format, HardwareGammaEnabled ),
																	 face, mip, (BufferUsage)Usage, doSoftware && mip == 0, HardwareGammaEnabled, FSAA );

					_surfaceList.Add( buf );

					// If format is PVRTC then every mipmap is a custom one so to allow the upload of the compressed data 
					// provided by the file we need to adjust the current mip level's dimention
#warning Compressed Textures are not yet supported by axiom
					/*
					if (mFormat == PF_PVRTC_RGB2 || mFormat == PF_PVRTC_RGBA2 ||
					mFormat == PF_PVRTC_RGB4 || mFormat == PF_PVRTC_RGBA4)
					{
						if (width > 1)
						{
							width = width / 2;
						}
						if (height > 1)
						{
							height = height / 2;
						}
					}*/
					/// Check for error
					if ( buf.Width == 0 ||
						buf.Height == 0 ||
						buf.Depth == 0 )
					{
						throw new AxiomException( string.Format( "Zero sized texture surface on texture: {0} face: {1} mipmap : {2}. The GL driver probably refused to create the texture.", Name, face, mip ) );
					}

				}
			}
		}
Example #4
0
		/// <summary>
		/// 
		/// </summary>
		/// <param name="src"></param>
		/// <param name="srcBox"></param>
		/// <param name="dstBox"></param>
		public void BlitFromTexture( GLESTextureBuffer src, BasicBox srcBox, BasicBox dstBox )
		{
			if ( !Root.Instance.RenderSystem.HardwareCapabilities.HasCapability( Capabilities.FrameBufferObjects ) )
			{
				// the following code depends on FBO support, it crashes if FBO is not supported.
				// TODO - write PBUFFER version of this function or a version that doesn't require FBO
				return;
			}

			/// Store reference to FBO manager
			throw new NotImplementedException();
		}