forgot the two attachments

-- 
Efraim Flashner   <[email protected]>   אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted
use SDL2::Raw;

die "couldn't initialize SDL2: { SDL_GetError }"
if SDL_Init(VIDEO) != 0;

my $window = SDL_CreateWindow(
    "Hello, world!",
    SDL_WINDOWPOS_CENTERED_MASK, SDL_WINDOWPOS_CENTERED_MASK,
    800, 600,
    OPENGL
);
my $render = SDL_CreateRenderer($window, -1, ACCELERATED +| PRESENTVSYNC);

my $event = SDL_Event.new;

main: loop {
    SDL_SetRenderDrawColor($render, 0, 0, 0, 0);
    SDL_RenderClear($render);

    while SDL_PollEvent($event) {
        if $event.type == QUIT {
            last main;
        }
    }

    SDL_SetRenderDrawColor($render, 255, 255, 255, 255);
    SDL_RenderFillRect($render,
    SDL_Rect.new(
        2 * min(now * 300 % 800, -now * 300 % 800),
        2 * min(now * 470 % 600, -now * 470 % 600),
        sin(3 * now) * 50 + 80, cos(4 * now) * 50 + 60));

        SDL_RenderPresent($render);
    }
    SDL_Quit;
(define-module (perl6-sdl2-raw)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix git-download)
  #:use-module (guix build-system rakudo)
  #:use-module (gnu packages perl6))

(define-public perl6-sdl2-raw
  (package
    (name "perl6-sdl2-raw")
    (version "0.3")
    (source
      (origin
        (method git-fetch)
        (uri (git-reference
               (url "https://github.com/timo/SDL2_Raw-p6.git";)
               (commit version)))
        (file-name (git-file-name name version))
        (sha256
         (base32
          "1h9g76bdps5aw14s6yxgnjfys9269vxiiq8728nrv8ccfynz64j3"))))
    (build-system rakudo-build-system)
    (home-page "https://github.com/timo/SDL2_Raw-p6";)
    (synopsis "Sugar-free NativeCall binding for libSDL2")
    (description "Sugar-free NativeCall binding for libSDL2")
    (license license:artistic2.0)))

perl6-sdl2-raw

Attachment: signature.asc
Description: PGP signature

Reply via email to