示例#1
0
        //The init function will create a font of
        //of the height h from the file fname.
        public void init(IOpenGLFunctions glView, string font, uint height)
        {
            // store the height of the font and the reference to the view providing openGL functions
            this.glView = glView;
            this.font   = font;
            this.height = height;

            //
            charEnabled = new bool[128];
            for (uint i = 0; i < 128; i++)
            {
                charEnabled[i] = true;
            }

            //
            init();
        }
示例#2
0
        //Free all the resources assosiated with the font.
        public void clean()
        {
            if (!initialized)
            {
                return;
            }

            // clear the lists and textures
            glView.glDeleteLists(list_base, 128);
            glView.glDeleteTextures(128, textures);

            // remove the reference
            glView = null;

            // flag as uninitialized
            initialized = false;
        }
示例#3
0
        public void init(IOpenGLFunctions glView, string font, uint height, string initCharacters)
        {
            // store the height of the font and the reference to the view providing openGL functions
            this.glView = glView;
            this.font   = font;
            this.height = height;

            byte[] bInitCharacters = System.Text.Encoding.ASCII.GetBytes(initCharacters);

            //
            charEnabled = new bool[128];
            for (uint i = 0; i < bInitCharacters.Length; i++)
            {
                if (bInitCharacters[i] >= 0 && bInitCharacters[i] <= 255)
                {
                    charEnabled[bInitCharacters[i]] = true;
                }
            }

            //
            init();
        }