MCPcopy Index your code
hub / github.com/processing/processing / initTexture

Method initTexture

core/src/processing/opengl/FontTexture.java:87–110  ·  view source on GitHub ↗
(PGraphicsOpenGL pg, PFont font)

Source from the content-addressed store, hash-verified

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) {

Callers 1

FontTextureMethod · 0.95

Calls 8

nextPowerOfTwoMethod · 0.95
minMethod · 0.95
maxMethod · 0.95
showWarningMethod · 0.95
addTextureMethod · 0.95
addAllGlyphsToTextureMethod · 0.95
getSizeMethod · 0.80
getGlyphCountMethod · 0.80

Tested by

no test coverage detected