Ejemplo n.º 1
0
 /**
  * @param fileName纹理图像文件名
  * @param game
  * @param mipmap是否自动生成mipmap
  */
 public GPTexture_20(String fileName, boolean mipmap) {
   super(fileName);
   fileIO = GPFileManager.getinstance();
   InputStream input = null;
   try {
     input = fileIO.readAsset(fileName);
     load(input, mipmap);
   } catch (Exception e) {
     e.printStackTrace();
   } finally {
     if (input != null) {
       try {
         input.close();
       } catch (IOException e) {
         e.printStackTrace();
       }
     }
   }
 }
Ejemplo n.º 2
0
 public void reload() {
   InputStream input = null;
   try {
     input = fileIO.readAsset(name);
     load(input, mipmap);
   } catch (Exception e) {
     e.printStackTrace();
   } finally {
     if (input != null) {
       try {
         input.close();
       } catch (IOException e) {
         e.printStackTrace();
       }
     }
   }
   bind();
   setFilter(GLES20.GL_NEAREST, GLES20.GL_LINEAR);
   GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, 0);
 }