Skip to content
/ glgif Public
forked from jamesu/glgif

A fast and comprehensive library for playing back .gif animations on the iPhone using OpenGLES

License

Notifications You must be signed in to change notification settings

gargs/glgif

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

glgif

What is it?

glgif is a fast and comprehensive library for playing back .gif animations on the iPhone using OpenGLES.

Sounds great, how do i use it?

At the core, glgif merely uploads frames from a gif animation to an OpenGLES texture. So all you need to do is the following:

// Load the gif
FILE *fp = fopen("test.gif", "r");
VideoSource *src = VideoSource_init(fp, VIDEOSOURCE_FILE);

// Init video using VideoSource
GifVideo *vid = [[GifVideo alloc] initWithSource:src inContext:[yourGLESContext]];
VideoSource_release(src);

// Start playing the video
[vid play:YES];

// Then every frame...
[vid getFrame]; // grab new frame data
glBindTexture(GL_TEXTURE_2D, vid.tex->tex); // bind the video texture!

Whoah, that is so complicated. Is there an easier way?

Why yes, indeed there is! An example project has been included which implements a nice OpenGLES view to display a test .gif. So all you need to do once you make a GifVideo* is:

[playerView startAnimation:vid]; 

Do any cool iPhone applications use this code?

The only app at the moment is anim8gif.

About

A fast and comprehensive library for playing back .gif animations on the iPhone using OpenGLES

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 65.4%
  • Objective-C 34.6%