I am attempting to animate a Roulette Wheel (European version) using the GDImage graphics library. The idea being instead of the whole wheel spinning, a chord (integer seg, segPositionAngle etc) runs around the wheel and stops on a random number.
However since changing
FILE *jpgImageFile = NULL;
to
FILE *animatedGIF;
animatedGIF = fopen( "animation.gif", "wb" );
Roulette = gdImageCreate( IMAGE_WIDTH, IMAGE_HEIGHT );
gdImageGifAnimBegin( Roulette, animatedGIF, USE_GLOBAL_COLORMAP, DO_NOT_LOOP_ANIMATION);
for ( frameCounter = 0; frameCounter <= MAX_FRAMES_COUNT; frameCounter++ )
{
gdImageDestroy( Roulette );
and
jpgImageFile = fopen( "RouletteImage.jpg", "wb" );
gdImageJpeg( Roulette, jpgImageFile, -1 );
fclose( jpgImageFile );
gdImageDestroy( Roulette );
to
gdImageGifAnimEnd( animatedGIF );
fclose( animatedGIF );
gdImageDestroy( Roulette );
}
The program compiles and runs fine, but displays nothing. I have tried changing these parts around and have had no luck so far. Not sure about what the compiler is, as a browser based form is used to input the code that my lecturer uses. If anyone has any ideas on how to get the Roulette Wheel to display, that would be great.