Наследование: IDisposable
Пример #1
0
        public void Dispose()
        {
            if (texture != null)
            {
                texture.Dispose();
            }

            texture = null;
        }
Пример #2
0
 public ESImage(int width, int height)
 {
     texture        = new ESTexture2D(IntPtr.Zero, SurfaceFormat.Color, width, height, new CGSize(width, height), All.Linear);
     imageWidth     = textureWidth = width;
     imageHeight    = textureHeight = height;
     texWidthRatio  = 1.0f / width;
     texHeightRatio = 1.0f / height;
     textureOffsetX = 0;
     textureOffsetY = 0;
 }
Пример #3
0
		public ESImage(int width, int height)
		{
			texture = new ESTexture2D(IntPtr.Zero,SurfaceFormat.Color,width,height,new Size(width,height),All.Linear);
			imageWidth = textureWidth = width;
			imageHeight = textureHeight = height;
			texWidthRatio = 1.0f / width;
			texHeightRatio = 1.0f / height;
			textureOffsetX = 0;
			textureOffsetY = 0;
		}
Пример #4
0
        static public ESTexture2D InitiFromDxt3File(BinaryReader rdr, int length, int width, int height)
        {
            byte [] b = GetBits(width, length, height, rdr);

            // Copy bits
            IntPtr pointer = Marshal.AllocHGlobal(length);

            Marshal.Copy(b, 0, pointer, length);
            ESTexture2D result = new ESTexture2D(pointer, SurfaceFormat.Dxt3, width, height, new Size(width, height), All.Linear);

            Marshal.FreeHGlobal(pointer);
            return(result);
        }
Пример #5
0
        public ESImage(IntPtr data, int width, int height)
        {
            if (GraphicsDevice.openGLESVersion == GLContextVersion.Gles2_0)
            {
                texture = new ESTexture2D(data, SurfaceFormat.Color, width, height, new Size(width, height), GL20.All.Nearest);
            }
            else
            {
                texture = new ESTexture2D(data, SurfaceFormat.Color, width, height, new Size(width, height), GL11.All.Nearest);
            }

            Initialize(1.0f);
        }
Пример #6
0
 public ESImage(Bitmap image)
 {
     // By default set the scale to 1.0f and the filtering to GL_NEAREST
     if (GraphicsDevice.openGLESVersion == GLContextVersion.Gles2_0)
     {
         texture = new ESTexture2D(image, GL20.All.Nearest);
     }
     else
     {
         texture = new ESTexture2D(image, GL11.All.Nearest);
     }
     Initialize(1.0f);
 }
Пример #7
0
        public ESImage(int width, int height)
        {
            if (GraphicsDevice.openGLESVersion == GLContextVersion.Gles2_0)
            {
                texture = new ESTexture2D(IntPtr.Zero, SurfaceFormat.Color, width, height, new Size(width, height), GL20.All.Linear);
            }
            else
            {
                texture = new ESTexture2D(IntPtr.Zero, SurfaceFormat.Color, width, height, new Size(width, height), GL11.All.Linear);
            }

            imageWidth     = textureWidth = width;
            imageHeight    = textureHeight = height;
            texWidthRatio  = 1.0f / width;
            texHeightRatio = 1.0f / height;
            textureOffsetX = 0;
            textureOffsetY = 0;
        }
Пример #8
0
 public ESImage(UIImage image, float imageScale, int lod, All filter)
 {
     texture = new ESTexture2D(image,filter, lod);
     Initialize(imageScale);
 }
Пример #9
0
 public ESImage(ESTexture2D tex)
 {
     texture = tex;
     Initialize(1.0f);
 }
Пример #10
0
 public ESImage(Bitmap image, All filter)
 {
     // By default set the scale to 1.0f
     texture = new ESTexture2D(image, filter);
     Initialize(1.0f);
 }
Пример #11
0
 public ESImage(ESTexture2D tex)
 {
     texture = tex;
     Initialize(1.0f);
 }
Пример #12
0
 public ESImage(Bitmap image, float imageScale, All filter)
 {
     texture = new ESTexture2D(image, filter);
     Initialize(imageScale);
 }
Пример #13
0
 public ESImage(Bitmap image)
 {
     // By default set the scale to 1.0f and the filtering to GL_NEAREST
     texture = new ESTexture2D(image, All.Nearest);
     Initialize(1.0f);
 }
Пример #14
0
 public ESImage(ESTexture2D tex)
     : this(tex,1.0f)
 {
 }
Пример #15
0
 public ESImage(UIImage image, float imageScale, All filter)
 {
     texture = new ESTexture2D(image, filter);
     Initialize(image.CurrentScale);
 }
Пример #16
0
 public ESImage(IntPtr data, int width, int height)
 {
     texture = new ESTexture2D(data, SurfaceFormat.Color, width, height, new Size(width, height), All.Nearest);
     Initialize(1.0f);
 }
Пример #17
0
		public ESImage(NSImage image, All filter)
		{			
			// By default set the scale to 1.0f
			texture = new ESTexture2D(image,filter);
			Initialize(1.0f/*TODO image.CurrentScale*/);
		}
Пример #18
0
 private Texture2D(ESTexture2D texture, string name)
 {
     this.texture = texture;
     this.Name    = name;
 }
Пример #19
0
 public ESImage(ESTexture2D tex, float imageScale)
 {
     texture = tex;
     Initialize(1.0f);
 }
Пример #20
0
 public ESImage(NSImage image)
 {
     // By default set the scale to 1.0f and the filtering to GL_NEAREST
     texture = new ESTexture2D(image, All.Nearest);
     Initialize(1.0f /*TODO image.CurrentScale*/);
 }
Пример #21
0
 public ESImage(Bitmap image, All filter)
 {
     // By default set the scale to 1.0f
     texture = new ESTexture2D(image, filter);
     Initialize(1.0f);
 }
Пример #22
0
 public ESImage(NSImage image, All filter)
 {
     // By default set the scale to 1.0f
     texture = new ESTexture2D(image, filter);
     Initialize(1.0f /*TODO image.CurrentScale*/);
 }
Пример #23
0
 public ESImage(IntPtr data, int width, int height)
 {
     texture = new ESTexture2D(data, SurfaceFormat.Color, width, height, new Size(width, height), All.Nearest);
     Initialize(1.0f);
 }
Пример #24
0
 public ESImage(ESTexture2D tex)
     : this(tex, 1.0f)
 {
 }
Пример #25
0
 public ESImage(Bitmap image)
 {
     // By default set the scale to 1.0f and the filtering to GL_NEAREST
     texture = new ESTexture2D(image, All.Nearest);
     Initialize(1.0f);
 }
Пример #26
0
 public ESImage(UIImage image, float imageScale, int lod, All filter)
 {
     texture = new ESTexture2D(image, filter, lod);
     Initialize(imageScale);
 }
Пример #27
0
 public ESImage(Bitmap image, float imageScale, All filter)
 {
     texture = new ESTexture2D(image, filter);
     Initialize(imageScale);
 }
Пример #28
0
        public void Dispose()
        {
            if (texture != null)
                texture.Dispose();

            texture = null;
        }
Пример #29
0
 public ESImage(ESTexture2D tex, float imageScale)
 {
     texture = tex;
     Initialize(1.0f);
 }
Пример #30
0
		public ESImage(NSImage image)
		{
			// By default set the scale to 1.0f and the filtering to GL_NEAREST
			texture = new ESTexture2D(image,All.Nearest);
			Initialize(1.0f/*TODO image.CurrentScale*/);			
		}
Пример #31
0
        public static ESTexture2D InitiFromDxt3File(BinaryReader rdr, int length, int width, int height)
        {
            byte [] b = GetBits (width, length, height, rdr);

            // Copy bits
            IntPtr pointer = Marshal.AllocHGlobal (length);
            Marshal.Copy (b, 0, pointer, length);
            ESTexture2D result = new ESTexture2D (pointer,SurfaceFormat.Dxt3,width,height,new Size (width,height),All.Linear);
            Marshal.FreeHGlobal (pointer);
            return result;
        }
Пример #32
0
 private Texture2D(ESTexture2D texture, string name)
 {
     this.texture = texture;
     this.Name = name;
 }