Package 

Class GLTexture

  • All Implemented Interfaces:
    com.serenegiant.opengl.ITexture

    
    public class GLTexture
     implements ITexture
                        

    OpenGL|ESのテクスチャ操作用のヘルパークラス

    • Constructor Summary

      Constructors 
      Constructor Description
      GLTexture(int width, int height, int filter_param) コンストラクタテクスチャユニットが常時GL_TEXTURE0なので複数のテクスチャを同時に使えない
      GLTexture(int texTarget, int texUnit, int width, int height, int filter_param) コンストラクタ
    • Method Summary

      Modifier and Type Method Description
      void release() テクスチャを破棄GLコンテキスト/EGLレンダリングコンテキスト内で呼び出すこと
      void bind() このインスタンスで管理しているテクスチャを有効にする(バインドする)
      void unbind() このインスタンスで管理しているテクスチャを無効にする(アンバインドする)
      int getTexTarget() テクスチャターゲットを取得(GL_TEXTURE_2D)
      int getTexture() テクスチャ名を取得
      Array<float> getTexMatrix() テクスチャ座標変換行列を取得(内部配列をそのまま返すので変更時は要注意)
      void getTexMatrix(Array<float> matrix, int offset) テクスチャ座標変換行列のコピーを取得
      int getTexWidth() テクスチャ幅を取得
      int getTexHeight() テクスチャ高さを取得
      void loadTexture(String filePath) 指定したファイルから画像をテクスチャに読み込むファイルが存在しないか読み込めなければIOException/NullPointerExceptionを生成
      void loadTexture(Bitmap bitmap) 指定したビットマップをテクスチャに読み込む
      • Methods inherited from class com.serenegiant.opengl.ITexture

        getTexMatrix, loadTexture, loadTexture
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GLTexture

        GLTexture(int width, int height, int filter_param)
        コンストラクタテクスチャユニットが常時GL_TEXTURE0なので複数のテクスチャを同時に使えない
        Parameters:
        width - テクスチャサイズ
        height - テクスチャサイズ
        filter_param - テクスチャの補間方法を指定 GL_LINEARとかGL_NEAREST
      • GLTexture

        GLTexture(int texTarget, int texUnit, int width, int height, int filter_param)
        コンストラクタ
        Parameters:
        texTarget - GL_TEXTURE_EXTERNAL_OESはだめ
        width - テクスチャサイズ
        height - テクスチャサイズ
        filter_param - テクスチャの補間方法を指定 GL_LINEARとかGL_NEAREST
    • Method Detail

      • release

         void release()

        テクスチャを破棄GLコンテキスト/EGLレンダリングコンテキスト内で呼び出すこと

      • bind

         void bind()

        このインスタンスで管理しているテクスチャを有効にする(バインドする)

      • unbind

         void unbind()

        このインスタンスで管理しているテクスチャを無効にする(アンバインドする)

      • getTexTarget

         int getTexTarget()

        テクスチャターゲットを取得(GL_TEXTURE_2D)

      • getTexture

         int getTexture()

        テクスチャ名を取得

      • getTexMatrix

         Array<float> getTexMatrix()

        テクスチャ座標変換行列を取得(内部配列をそのまま返すので変更時は要注意)

      • getTexMatrix

         void getTexMatrix(Array<float> matrix, int offset)

        テクスチャ座標変換行列のコピーを取得

        Parameters:
        matrix - 領域チェックしていないのでoffset位置から16個以上確保しておくこと
      • getTexWidth

         int getTexWidth()

        テクスチャ幅を取得

      • getTexHeight

         int getTexHeight()

        テクスチャ高さを取得

      • loadTexture

         void loadTexture(String filePath)

        指定したファイルから画像をテクスチャに読み込むファイルが存在しないか読み込めなければIOException/NullPointerExceptionを生成

      • loadTexture

         void loadTexture(Bitmap bitmap)

        指定したビットマップをテクスチャに読み込む