### ----------------------------------------------------
### -- GD::Raw
### -- Licenses: Artistic-2.0
### -- Authors: Dagur Valberg Johannsson, Raku Community
### -- File: xt/gdimageopenpolygon2.rakutest
### ----------------------------------------------------
use Test;
use GD::Raw;

use lib $*PROGRAM.parent;
use gdtest;

plan 1;

my $im = gdImageCreate(100, 100) or die;
LEAVE gdImageDestroy($im) if $im;

my $white = gdImageColorAllocate($im, 0xff, 0xff, 0xff);
my $black = gdImageColorAllocate($im, 0, 0, 0);

gdImageFilledRectangle($im, 0, 0, 99, 99, $white);

my @points;
@points[0]   = gdPointPtr.new;
@points[0].x = 10;
@points[0].y = 10;
@points[1]   = gdPointPtr.new;
@points[1].x = 50;
@points[1].y = 70;

gdImageOpenPolygon($im, @points, 2, $black);

ok gdAssertImageEqualsToFile
  $*PROGRAM.sibling("ported-gdimageopenpolygon/gdimageopenpolygon2.png"),
  $im
;

# vim: expandtab shiftwidth=4


