public static BaseTexture FromBuffer(BaseDevice device, BaseTextureDesc desc, UInt32[] buffer, Boolean resample = false) { if (ExistsInPool(desc.Name)) { return(TexturePool[desc.Name]); } var texture = ( BaseTexture )Activator.CreateInstance(device.TextureType, device, desc); texture.Initialise(buffer); texture.Upload(resample); return(texture); }
public static BaseTexture FromBuffer(BaseDevice device, BaseTextureDesc desc, ByteArraySegment buffer, bool resample = true) { if (BaseTexture.ExistsInPool(desc.Name)) { return(BaseTexture.TexturePool[desc.Name]); } var texture = ( BaseTexture )Activator.CreateInstance(device.TextureType, device, desc); texture.Initialise(buffer); texture.Upload(resample); return(texture); }
public BaseTexture(BaseDevice device, BaseTextureDesc desc) { Device = device; Desc = desc; TexturePool.Add(desc.Name, this); if (Desc.IsLightMap) { LightMapData = new Int32[RenderDef.MAX_LIGHTMAPS, RenderDef.BLOCK_WIDTH]; LightMapRectChange = new glRect_t[RenderDef.MAX_LIGHTMAPS]; // lightmap_rectchange LightMapModified = new System.Boolean[RenderDef.MAX_LIGHTMAPS]; // lightmap_modified } }
public BaseTexture(BaseDevice device, BaseTextureDesc desc) { this.Device = device; this.Desc = desc; BaseTexture.TexturePool.Add(desc.Name, this); if (this.Desc.IsLightMap) { this.LightMapData = new int[RenderDef.MAX_LIGHTMAPS, RenderDef.BLOCK_WIDTH]; this.LightMapRectChange = new glRect_t[RenderDef.MAX_LIGHTMAPS]; // lightmap_rectchange this.LightMapModified = new bool[RenderDef.MAX_LIGHTMAPS]; // lightmap_modified } }