//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(); }
//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; }
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(); }