Search in sources :

Example 1 with GifTexImage2D

use of pl.droidsonroids.gif.GifTexImage2D in project android-gif-drawable by koral--.

the class GifTexImage2DFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    if (!isOpenGLES2Supported()) {
        Snackbar.make(container, R.string.gles2_not_supported, Snackbar.LENGTH_LONG).show();
        return null;
    }
    try {
        GifOptions options = new GifOptions();
        options.setInIsOpaque(true);
        mGifTexImage2D = new GifTexImage2D(new InputSource.ResourcesSource(getResources(), R.drawable.anim_flag_chile), options);
    } catch (IOException e) {
        throw new IllegalStateException(e);
    }
    final GLSurfaceView view = (GLSurfaceView) inflater.inflate(R.layout.opengl, container, false);
    view.setEGLContextClientVersion(2);
    view.setRenderer(new Renderer());
    view.getHolder().setFixedSize(mGifTexImage2D.getWidth(), mGifTexImage2D.getHeight());
    mGifTexImage2D.startDecoderThread();
    return view;
}
Also used : IOException(java.io.IOException) GifOptions(pl.droidsonroids.gif.GifOptions) GifTexImage2D(pl.droidsonroids.gif.GifTexImage2D) GLSurfaceView(android.opengl.GLSurfaceView)

Aggregations

GLSurfaceView (android.opengl.GLSurfaceView)1 IOException (java.io.IOException)1 GifOptions (pl.droidsonroids.gif.GifOptions)1 GifTexImage2D (pl.droidsonroids.gif.GifTexImage2D)1