perl 6 bindings to graffiks
Switch branches/tags
Nothing to show
Latest commit 95a5a22 Oct 28, 2016 @wentam committed on GitHub Merge pull request #3 from zoffixznet/patch-1
Add mandatory "perl" META field
Failed to load latest commit information.
lib add more primitive types Jun 11, 2015
LICENSE Initial commit May 18, 2015 Add mandatory "perl" META field Oct 26, 2016 Update Jun 10, 2015


perl 6 bindings to Graffiks

Example usage

The following will create a spinning cube:

use v6;
use Graffiks;
use Graffiks::Camera;
use Graffiks::PointLight;
use Graffiks::Mesh;
use Graffiks::Material;
use Graffiks::Object; => &init,
             update => &update);

my $object;

sub init ($gfks, $window_width, $window_height) {
  # enable the deferred renderer

  # create, position, and make our camera the active one
  my $camera =;

  # create and position a point light (without light, you won't see anything!)
  my $light =;

  # create a cube mesh
  my $mesh =;

  # create a material
  my $material =;

  # create an object with the previously created mesh and material
  $object =$mesh),$material));

sub update ($gfks, $time_step) {
  # rotate our object based on $time_step
  my $a = $object.angle-w();
  $object.set-rotation(angle => $a+(0.05*$time_step),
                       x => 0,
                       y => 1,
                       z => 1);