public void SetData(ITextureSource src) { GPUStateMachine.BindTexture(0, src.GetTextureTarget(), id); switch (src.GetDimensions()) { case 1: GL.TexImage1D(src.GetTextureTarget(), src.GetLevels(), src.GetInternalFormat(), src.GetWidth(), 0, src.GetFormat(), src.GetType(), src.GetPixelData()); break; case 2: GL.TexImage2D(src.GetTextureTarget(), src.GetLevels(), src.GetInternalFormat(), src.GetWidth(), src.GetHeight(), 0, src.GetFormat(), src.GetType(), src.GetPixelData()); break; case 3: GL.TexImage3D(src.GetTextureTarget(), src.GetLevels(), src.GetInternalFormat(), src.GetWidth(), src.GetHeight(), src.GetDepth(), 0, src.GetFormat(), src.GetType(), src.GetPixelData()); break; } GL.GenerateMipmap((GenerateMipmapTarget)src.GetTextureTarget()); GPUStateMachine.UnbindTexture(0, src.GetTextureTarget()); this.Width = src.GetWidth(); this.Height = src.GetHeight(); this.Depth = src.GetDepth(); this.LevelCount = src.GetLevels(); this.format = src.GetFormat(); this.internalformat = src.GetInternalFormat(); this.texTarget = src.GetTextureTarget(); }
public int GetLevels() { return(texSrc.GetLevels()); }