Exemple #1
0
        public StringRenderer(IGL owner, Stream xml, params Stream[] textures)
        {
            Owner    = owner;
            FontInfo = Cyotek.Drawing.BitmapFont.BitmapFontLoader.LoadFontFromXmlFile(xml);

            //load textures
            for (int i = 0; i < FontInfo.Pages.Length; i++)
            {
                TexturePages.Add(owner.LoadTexture(textures[i]));
            }
        }
        public StringRenderer(IGL owner, Stream xml, params Stream[] textures)
        {
            Owner    = owner;
            FontInfo = new();
            FontInfo.LoadXml(xml);

            // load textures
            for (int i = 0; i < FontInfo.Pages.Length; i++)
            {
                TexturePages.Add(owner.LoadTexture(textures[i]));
            }
        }
Exemple #3
0
        /// <summary>

        /// Constructor

        /// </summary>

        private TextureManager()

        {
            long w = Options.Instance.World_Width;
            long h = Options.Instance.World_Height;

            long i, j;

            //Setup the page array
            //    mTexture.reserve (w);
            //    mTexture.resize (w);
            textures = new TexturePages();
            for (i = 0; i < w; i++)
            {
                TextureRow tr = new TextureRow();
                textures.Add(tr);

                //        mTexture[i].reserve (h);
                //        mTexture[i].resize (h);
                for (j = 0; j < h; j++)
                {
                    tr.Add(null);
                }
            }
            //Populate the page array
            if (Options.Instance.TextureFormat == "Image")
            {
                for (j = 0; j < h; j++)
                {
                    for (i = 0; i < w; i++)
                    {
                        textures[i][j] = new Texture_Image();
                    }
                }
            }
            else if (Options.Instance.TextureFormat == "Splatting5")
            {
                for (j = 0; j < h; j++)
                {
                    for (i = 0; i < w; i++)
                    {
                        textures[i][j] = new Texture_Splatting5();
                    }
                }
            }
        }