continues the removal of static references

This commit is contained in:
codeanticode
2014-01-20 12:14:35 -05:00
parent a8a15d112e
commit f2c730b58f
10 changed files with 262 additions and 202 deletions

View File

@@ -63,11 +63,12 @@ class FontTexture implements PConstants {
protected TextureInfo[] glyphTexinfos;
protected HashMap<PFont.Glyph, TextureInfo> texinfoMap;
public FontTexture(PFont font, boolean is3D) {
pgl = PGraphicsOpenGL.pgPrimary.pgl;
public FontTexture(PGraphicsOpenGL pg, PFont font, boolean is3D) {
pgl = pg.pgl;
this.is3D = is3D;
initTexture(PGraphicsOpenGL.pgPrimary, font);
initTexture(pg, font);
}
@@ -130,15 +131,15 @@ class FontTexture implements PConstants {
if (is3D) {
// Bilinear sampling ensures that the texture doesn't look pixelated
// either when it is magnified or minified...
tex = new Texture(w, h, new Texture.Parameters(ARGB, Texture.BILINEAR,
false));
tex = new Texture(pg, w, h,
new Texture.Parameters(ARGB, Texture.BILINEAR, false));
} else {
// ...however, the effect of bilinear sampling is to add some blurriness
// to the text in its original size. In 2D, we assume that text will be
// shown at its original size, so linear sampling is chosen instead (which
// only affects minimized text).
tex = new Texture(w, h, new Texture.Parameters(ARGB, Texture.LINEAR,
false));
tex = new Texture(pg, w, h,
new Texture.Parameters(ARGB, Texture.LINEAR, false));
}
if (textures == null) {