//default constructor which initializes tiles in order from 1 - 15 TileShop::TileShop() { moves = 0; pictures = load_bmp("tiles.bmp", NULL); click = load_sample("click.wav"); for (int i = 0; i < 16; i++) { tiles[i] = Tile(i, pictures); } sortTiles(); }
/* render and display the current model */ static void renderFrame (struct state *st) { int n; /* This assumes black is zero. */ memset (st->workImage->data, 0, st->workImage->bytes_per_line * st->workImage->height); sortTiles (st); for (n = 0; n < st->tileCount; n++) { renderTile (st, st->sortedTiles[n]); } put_xshm_image (st->dpy, st->window, st->backgroundGC, st->workImage, 0, 0, 0, 0, st->windowWidth, st->windowHeight, &st->shmInfo); }