Inheritance: IDisposable
Beispiel #1
0
        public void Dispose()
        {
            if (texture != null)
            {
                texture.Dispose();
            }

            texture = null;
        }
Beispiel #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;
 }
Beispiel #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;
		}
Beispiel #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);
        }
Beispiel #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);
        }
Beispiel #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);
 }
Beispiel #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;
        }
Beispiel #8
0
 public ESImage(UIImage image, float imageScale, int lod, All filter)
 {
     texture = new ESTexture2D(image,filter, lod);
     Initialize(imageScale);
 }
Beispiel #9
0
 public ESImage(ESTexture2D tex)
 {
     texture = tex;
     Initialize(1.0f);
 }
Beispiel #10
0
 public ESImage(Bitmap image, All filter)
 {
     // By default set the scale to 1.0f
     texture = new ESTexture2D(image, filter);
     Initialize(1.0f);
 }
Beispiel #11
0
 public ESImage(ESTexture2D tex)
 {
     texture = tex;
     Initialize(1.0f);
 }
Beispiel #12
0
 public ESImage(Bitmap image, float imageScale, All filter)
 {
     texture = new ESTexture2D(image, filter);
     Initialize(imageScale);
 }
Beispiel #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);
 }
Beispiel #14
0
 public ESImage(ESTexture2D tex)
     : this(tex,1.0f)
 {
 }
Beispiel #15
0
 public ESImage(UIImage image, float imageScale, All filter)
 {
     texture = new ESTexture2D(image, filter);
     Initialize(image.CurrentScale);
 }
Beispiel #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);
 }
Beispiel #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*/);
		}
Beispiel #18
0
 private Texture2D(ESTexture2D texture, string name)
 {
     this.texture = texture;
     this.Name    = name;
 }
Beispiel #19
0
 public ESImage(ESTexture2D tex, float imageScale)
 {
     texture = tex;
     Initialize(1.0f);
 }
Beispiel #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*/);
 }
Beispiel #21
0
 public ESImage(Bitmap image, All filter)
 {
     // By default set the scale to 1.0f
     texture = new ESTexture2D(image, filter);
     Initialize(1.0f);
 }
Beispiel #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*/);
 }
Beispiel #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);
 }
Beispiel #24
0
 public ESImage(ESTexture2D tex)
     : this(tex, 1.0f)
 {
 }
Beispiel #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);
 }
Beispiel #26
0
 public ESImage(UIImage image, float imageScale, int lod, All filter)
 {
     texture = new ESTexture2D(image, filter, lod);
     Initialize(imageScale);
 }
Beispiel #27
0
 public ESImage(Bitmap image, float imageScale, All filter)
 {
     texture = new ESTexture2D(image, filter);
     Initialize(imageScale);
 }
Beispiel #28
0
        public void Dispose()
        {
            if (texture != null)
                texture.Dispose();

            texture = null;
        }
Beispiel #29
0
 public ESImage(ESTexture2D tex, float imageScale)
 {
     texture = tex;
     Initialize(1.0f);
 }
Beispiel #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*/);			
		}
Beispiel #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;
        }
Beispiel #32
0
 private Texture2D(ESTexture2D texture, string name)
 {
     this.texture = texture;
     this.Name = name;
 }