{"id":14966153,"url":"https://github.com/timo/sdl2_raw-p6","last_synced_at":"2025-09-12T00:46:24.902Z","repository":{"id":22592372,"uuid":"25934304","full_name":"timo/SDL2_raw-p6","owner":"timo","description":"Low-level NativeCall binding to SDL2","archived":false,"fork":false,"pushed_at":"2022-08-12T20:13:42.000Z","size":159,"stargazers_count":12,"open_issues_count":7,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-31T07:51:27.377Z","etag":null,"topics":["graphics-library","perl6","perl6-module","sdl2"],"latest_commit_sha":null,"homepage":null,"language":"Raku","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"artistic-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/timo.png","metadata":{"files":{"readme":"README.md","changelog":"Changes","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-10-29T18:04:28.000Z","updated_at":"2023-09-02T11:30:20.000Z","dependencies_parsed_at":"2022-08-20T20:50:40.296Z","dependency_job_id":null,"html_url":"https://github.com/timo/SDL2_raw-p6","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timo%2FSDL2_raw-p6","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timo%2FSDL2_raw-p6/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timo%2FSDL2_raw-p6/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/timo%2FSDL2_raw-p6/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/timo","download_url":"https://codeload.github.com/timo/SDL2_raw-p6/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238174106,"owners_count":19428626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["graphics-library","perl6","perl6-module","sdl2"],"created_at":"2024-09-24T13:35:56.055Z","updated_at":"2025-02-10T19:30:43.957Z","avatar_url":"https://github.com/timo.png","language":"Raku","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SDL2::Raw\n\n [![Build Status](https://travis-ci.org/timo/SDL2_raw-p6.svg?branch=master)](https://travis-ci.org/timo/SDL2_raw-p6) [![Build status](https://ci.appveyor.com/api/projects/status/github/timo/SDL2_raw-p6?svg=true)](https://ci.appveyor.com/project/timo/SDL2_raw-p6/branch/master)\n\nA low-sugar binding to SDL2.\n\n## Synopsis\n\n```perl6\nuse SDL2::Raw;\n\ndie \"couldn't initialize SDL2: { SDL_GetError }\"\n  if SDL_Init(VIDEO) != 0;\n\nmy $window = SDL_CreateWindow(\n    \"Hello, world!\",\n    SDL_WINDOWPOS_CENTERED_MASK, SDL_WINDOWPOS_CENTERED_MASK,\n    800, 600,\n    OPENGL\n);\nmy $render = SDL_CreateRenderer($window, -1, ACCELERATED +| PRESENTVSYNC);\n\nmy $event = SDL_Event.new;\n\nmain: loop {\n    SDL_SetRenderDrawColor($render, 0, 0, 0, 0);\n    SDL_RenderClear($render);\n\n    while SDL_PollEvent($event) {\n        if $event.type == QUIT {\n            last main;\n        }\n    }\n\n    SDL_SetRenderDrawColor($render, 255, 255, 255, 255);\n    SDL_RenderFillRect($render,\n        SDL_Rect.new(\n            2 * min(now * 300 % 800, -now * 300 % 800),\n            2 * min(now * 470 % 600, -now * 470 % 600),\n        sin(3 * now) * 50 + 80, cos(4 * now) * 50 + 60));\n\n    SDL_RenderPresent($render);\n}\nSDL_Quit;\n```\n\n## Status\n\nThere's a bunch of functions and structs already covered, but there's also a whole bunch of things I haven't touched at all. If you need any specific part of the API covered, feel free to open a ticket on github or even a pull request!\n\n## Installation\n\n|Platform|Installation|\n|-|-|\n|Ubuntu 14.04 and above|`sudo apt install libsdl2-dev`|\n|Fedora 25 and above|`yum install SDL2-devel`|\n|Arch Linux|`pacman -S sdl2`|\n|Gentoo|`emerge -av libsdl2`|\n|macOS|`brew install sdl2 pkg-config`|\n|Windows|https://libsdl.org/download-2.0.php|\n\n## Examples\n\n### Snake\n\n![screenshots/snake-screenshot.png](screenshots/snake-screenshot.png)\n\nA simple Snake game. Control it with the arrow keys, guide your snake to eat the red circles, and avoid running into your tail.\n\nThis code uses `Cairo` to create the images for the snake's body and tail.\n\n### Particles\n\n![screenshots/particles-screenshot.png](screenshots/particles-screenshot.png)\n\nA very simple particle system that spews white pixels from a central point that get pulled down by gravity and bounce on the floor.\n\n### Shooter\n\n![screenshots/shooter-screenshot.png](screenshots/shooter-screenshot.png)\n\nA more complicated game. Control it with the arrow keys and hold the spacebar to fire.\n\nThe code also uses `Cairo` to render the player's spaceship and the enemy spaceships. In generating the starfields it shows how to render to a texture with `SDL2`.\n\n### White Noise\n\nJust draws random white and black pixels to a texture and displays it.\n\n![screenshots/white-noise-screenshot.png](screenshots/white-noise-screenshot.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimo%2Fsdl2_raw-p6","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftimo%2Fsdl2_raw-p6","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftimo%2Fsdl2_raw-p6/lists"}