//temporalVisualizer.c - display temporal distortion portals in video
#include <stdio.h>
#include <math.h>
#include "SDL.h"
#include "SDL_image.h"
#define WIDTH 1024 // screen dimensions
#define HEIGHT 768
#define MAX_IMAGES 110 // number of frames to read from disk
#define PORTAL_DIA 50 // center distortion portal size
// use 1 for per pixel correctness, multiples of ten for faster 'chunking'
int chunkSize=1;
int pixels[WIDTH][HEIGHT]; // frame number at each pixel coordinate
int animateGrid[WIDTH][HEIGHT]; // record animation position at each pixel
SDL_Surface *screen; // surface to display to user
SDL_Event event; // keyboard, mouse event handling
SDL_Surface* immutableImage; // base image to overwrite each frame
SDL_Surface* frame[MAX_IMAGES]; // array of frames to animate
SDL_Rect baseRect; // immutable image clipping rect
SDL_Rect src; // current frame clipping rect
int mouseX = 0;
int mouseY = 0;
int mouseIsDown = 0;
int stopMainLoop = 0;