Example #1
0
        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);
        }
Example #2
0
        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);
        }
Example #3
0
        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
            }
        }
Example #4
0
        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
            }
        }