#!/usr/bin/php5 * * This file is a Php port of "cxx/cpptest.cpp" * which is: * Copyright (c) 2006 Jean-Yves Lamoureux * All Rights Reserved * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want * To Public License, Version 2, as published by Sam Hocevar. See * http://sam.zoy.org/wtfpl/COPYING for more details. */ $pig_str = <<= caca_get_canvas_width($canvas) || $x < 0 ) $x = 0; if ($y + caca_get_canvas_height($pig) - 1 >= caca_get_canvas_height($canvas) || $y < 0 ) $y = 0; caca_clear_canvas($canvas); // Draw caca_blit($canvas, $x, $y, $pig); caca_put_str($canvas, caca_get_canvas_width($canvas) / 2 - 10, caca_get_canvas_height($canvas) / 2, "Powered by libcaca ".caca_get_version()); caca_refresh_display($display); // Move cursor $x += $ix; $y += $iy; if ($x + caca_get_canvas_width($pig) >= caca_get_canvas_width($canvas) || $x < 0 ) $ix = -$ix; if ($y + caca_get_canvas_height($pig) >= caca_get_canvas_height($canvas) || $y < 0 ) $iy = -$iy; } ?>