Example #1
0
        //============================================================
        public void LoadResource(FDxRsTemplateTexture resource)
        {
            _typeName = EDxTexture.ToName(resource.TypeCd);
            int             packCd   = EDxTexture.ToPack(resource.TypeCd);
            FDxModelTexture _texture = RDxCore.TextureConsole.Get(_device, resource.Source, packCd);

            _nativeTexture  = _texture.NativeTexture;
            _nativeResource = _texture.NativeResource;
        }
Example #2
0
        //============================================================
        public FDxModelTexture Get(FDxDevice3D device, string code, int typeCd)
        {
            string          name    = code + "|" + typeCd;
            FDxModelTexture texture = _textures.Find(name);

            if (null == texture)
            {
                // 创建模型
                texture        = new FDxModelTexture();
                texture.Device = device;
                // 加载模型资源
                FDxRsTexturePack       rsTexture = RDxCore.TextureResourceConsole.Get(code);
                FDxRsTextureBitmapPack rsPack    = rsTexture.Packs[typeCd];
                texture.LoadResource(rsPack);
                // 存储模型
                _textures.Set(name, texture);
            }
            return(texture);
        }