Example #1
0
        private void ApplyTextureOptions(GL10 pGL)
        {
            TextureOptions textureOptions = this.mTextureOptions;

            pGL.GlTexParameterf(GL10Consts.GlTexture2d, GL10Consts.GlTextureMinFilter, textureOptions.mMinFilter);
            pGL.GlTexParameterf(GL10Consts.GlTexture2d, GL10Consts.GlTextureMagFilter, textureOptions.mMagFilter);
            pGL.GlTexParameterf(GL10Consts.GlTexture2d, GL10Consts.GlTextureWrapS, textureOptions.mWrapS);
            pGL.GlTexParameterf(GL10Consts.GlTexture2d, GL10Consts.GlTextureWrapT, textureOptions.mWrapT);
            pGL.GlTexEnvf(GL10Consts.GlTextureEnv, GL10Consts.GlTextureEnvMode, textureOptions.mTextureEnvironment);
        }
Example #2
0
        /**
         * @param pWidth must be a power of 2 (i.e. 32, 64, 128, 256, 512, 1024).
         * @param pHeight must be a power of 2 (i.e. 32, 64, 128, 256, 512, 1024).
         * @param pTextureOptions the (quality) settings of the Texture.
         * @param pTextureStateListener to be informed when this {@link Texture} is loaded, unloaded or a {@link ITextureSource} failed to load.
         */
        protected void Init(int pWidth, int pHeight, TextureOptions pTextureOptions, ITextureStateListener pTextureStateListener) /* throws IllegalArgumentException */
        {
            if (!MathUtils.IsPowerOfTwo(pWidth) || !MathUtils.IsPowerOfTwo(pHeight))
            {
                throw new IllegalArgumentException("Width and Height of a Texture must be a power of 2!");
            }

            this.mWidth                = pWidth;
            this.mHeight               = pHeight;
            this.mTextureOptions       = pTextureOptions;
            this.mTextureStateListener = pTextureStateListener;
        }
 /**
  * @param pWidth must be a power of 2 (i.e. 32, 64, 128, 256, 512, 1024).
  * @param pHeight must be a power of 2 (i.e. 32, 64, 128, 256, 512, 1024).
  * @param pTextureOptions the (quality) settings of the Texture.
  * @param pTextureStateListener to be informed when this {@link BuildableTexture} is loaded, unloaded or a {@link ITextureSource} failed to load.
  */
 public BuildableTexture(int pWidth, int pHeight, TextureOptions pTextureOptions, ITextureStateListener pTextureStateListener) /* throws IllegalArgumentException */
     : base(pWidth, pHeight, pTextureOptions, pTextureStateListener)
 {
 }
 /**
  * @param pWidth must be a power of 2 (i.e. 32, 64, 128, 256, 512, 1024).
  * @param pHeight must be a power of 2 (i.e. 32, 64, 128, 256, 512, 1024).
  * @param pTextureOptions the (quality) settings of the Texture.
  */
 public BuildableTexture(int pWidth, int pHeight, TextureOptions pTextureOptions) /* throws IllegalArgumentException */
     : base(pWidth, pHeight, pTextureOptions, null)
 {
 }
Example #5
0
 /**
  * @param pWidth must be a power of 2 (i.e. 32, 64, 128, 256, 512, 1024).
  * @param pHeight must be a power of 2 (i.e. 32, 64, 128, 256, 512, 1024).
  * @param pTextureOptions the (quality) settings of the Texture.
  * @param pTextureStateListener to be informed when this {@link Texture} is loaded, unloaded or a {@link ITextureSource} failed to load.
  */
 public Texture(int pWidth, int pHeight, TextureOptions pTextureOptions, ITextureStateListener pTextureStateListener) /* throws IllegalArgumentException */
 {
     Init(pWidth, pHeight, pTextureOptions, pTextureStateListener);
 }
Example #6
0
 /**
  * @param pWidth must be a power of 2 (i.e. 32, 64, 128, 256, 512, 1024).
  * @param pHeight must be a power of 2 (i.e. 32, 64, 128, 256, 512, 1024).
  * @param pTextureOptions the (quality) settings of the Texture.
  */
 public Texture(int pWidth, int pHeight, TextureOptions pTextureOptions) /* throws IllegalArgumentException */
 {
     Init(pWidth, pHeight, pTextureOptions, null);
 }
Example #7
0
        public static Texture CreateForTextureSourceSize(ITextureSource pTextureSource, TextureOptions pTextureOptions)
        {
            int loadingScreenWidth  = pTextureSource.GetWidth();
            int loadingScreenHeight = pTextureSource.GetHeight();

            return(new Texture(MathUtils.NextPowerOfTwo(loadingScreenWidth), MathUtils.NextPowerOfTwo(loadingScreenHeight), pTextureOptions));
        }