/** * Creates and populates a (not necessarily power of two) texture for use as our main texture. */ protected int createMainTex() { // the mipmaps flag is always false here because we only ever generate mipmaps for our // power-of-two textures; scaleTexture will use tex to create the POT texture, so tex should // not have mipmaps enabled, or it will hose up that process int tex = ctx.createTexture(false, false, false); updateTexture(tex); return tex; }
/** * Called by canvas image implementations in {@link #ensureTexture} to either cause their texture * data to be reuploaded (in the simple case where the image is neither repeated nor mipmapped), * or their texture to be destroyed so that it is subsequently recreated with updated texture * data. */ protected void refreshTexture() { if (repeatX || repeatY || mipmapped) clearTexture(); else if (tex > 0) updateTexture(tex); }
/** * Creates and populates a texture for use as our power-of-two texture. This is used when our * main image data is already power-of-two-sized. */ protected int createPow2RepTex(int width, int height, boolean repeatX, boolean repeatY, boolean mipmapped) { int powtex = ctx.createTexture(width, height, repeatX, repeatY, mipmapped); updateTexture(powtex); return powtex; }