(PGraphicsOpenGL pg, PFont font)
| 85 | |
| 86 | |
| 87 | protected void initTexture(PGraphicsOpenGL pg, PFont font) { |
| 88 | lastTex = -1; |
| 89 | |
| 90 | int spow = PGL.nextPowerOfTwo(font.getSize()); |
| 91 | minSize = PApplet.min(PGraphicsOpenGL.maxTextureSize, |
| 92 | PApplet.max(PGL.MIN_FONT_TEX_SIZE, spow)); |
| 93 | maxSize = PApplet.min(PGraphicsOpenGL.maxTextureSize, |
| 94 | PApplet.max(PGL.MAX_FONT_TEX_SIZE, 2 * spow)); |
| 95 | |
| 96 | if (maxSize < spow) { |
| 97 | PGraphics.showWarning("The font size is too large to be properly " + |
| 98 | "displayed with OpenGL"); |
| 99 | } |
| 100 | |
| 101 | addTexture(pg); |
| 102 | |
| 103 | offsetX = 0; |
| 104 | offsetY = 0; |
| 105 | lineHeight = 0; |
| 106 | |
| 107 | texinfoMap = new HashMap<PFont.Glyph, TextureInfo>(); |
| 108 | glyphTexinfos = new TextureInfo[font.getGlyphCount()]; |
| 109 | addAllGlyphsToTexture(pg, font); |
| 110 | } |
| 111 | |
| 112 | |
| 113 | public boolean addTexture(PGraphicsOpenGL pg) { |
no test coverage detected