primary surface is used as key object when setting the cache for font textures

This commit is contained in:
codeanticode
2012-07-24 19:49:36 +00:00
parent 4ec94261c8
commit c867cd712c

View File

@@ -3319,12 +3319,12 @@ public class PGraphicsOpenGL extends PGraphics {
textTex = (PFontTexture)textFont.getCache(pgPrimary);
if (textTex == null) {
textTex = new PFontTexture(parent, textFont, maxTextureSize, maxTextureSize, is3D());
textFont.setCache(this, textTex);
textFont.setCache(pgPrimary, textTex);
} else {
if (textTex.contextIsOutdated()) {
textTex = new PFontTexture(parent, textFont, PApplet.min(PGL.MAX_FONT_TEX_SIZE, maxTextureSize),
PApplet.min(PGL.MAX_FONT_TEX_SIZE, maxTextureSize), is3D());
textFont.setCache(this, textTex);
textFont.setCache(pgPrimary, textTex);
}
}
textTex.setFirstTexture();