rforcen / qt-metal

qt metal c++ interface

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

qt-metal

qt metal c++ interface

use apple metal resources in a convenient qt wrapper,

virtual memory manager is implemented in a VM_Vect vector alike class,

interfacing with qt widget is simple using VM_Vect's and metal parametric call:

void DomainColoringWidget::paint(QPainter& p) { w = p.device()->width(); h = p.device()->height();

VM_Vect pic(w * h); // pic buffer -> w x h VM_Vect<__byte> code(_c->zc->getCode(), _c->zc->codeLength()); VM_Vect constants(_c->zc->getConsts(), _c->zc->constsLength()); simd_int4 geo{0, 0, w, h};

_c->metal->call("domainColorzFunc", w, h, {&pic, &geo, &code, &constants});

// pic is available now -> draw p.drawImage(0, 0, QImage((uchar*)pic.data(), w, h, QImage::Format_ARGB32)); }

i've also added a metal.xml sytax highlighting file. obviously this is only for macos.

inspired in Nikolay's mtlpp: https://github.com/naleksiev/mtlpp

About

qt metal c++ interface


Languages

Language:Objective-C++ 51.3%Language:C++ 40.5%Language:Metal 5.9%Language:Objective-C 1.3%Language:QMake 0.5%Language:C 0.4%Language:Shell 0.1%