PHP code example of microscrap / cuda-gfx
1. Go to this page and download the library: Download microscrap/cuda-gfx library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
microscrap / cuda-gfx example snippets
use Microscrap\GFX\CUDA\CudaFramebuffer;
use ScrapyardIO\Tubes\Core\MagicAliases\Framebuffer;
use ScrapyardIO\Tubes\Core\MagicAliases\Window;
$gpu = Framebuffer::driver('cuda')
->size(320, 240)
->format(CudaFramebuffer::rgbaSpec())
->create();
$gpu->setPixel(10, 10, 0xFF0000FF);
$bytes = $gpu->flush(CudaFramebuffer::rgbaSpec());
$window = Window::driver('cuda')->title('CUDA')->size(800, 600)->open();
$fb = $window->framebuffer(); // CudaFramebuffer, not headless
$fb->fill(0xFF203040)->setPixel(10, 10, 0xFFFFFFFF);
$window->present()->pollEvents();