mirror of
https://github.com/86Box/86Box.git
synced 2026-02-24 20:35:32 -07:00
in gleswidget to renderstack (a QStackWidget), which in turn calls an actual renderer. added ability to target GLES directly, but this is maybe uneeded.
23 lines
504 B
C++
23 lines
504 B
C++
#include "qt_softwarerenderer.hpp"
|
|
|
|
#include <QPainter>
|
|
|
|
SoftwareRenderer::SoftwareRenderer(QWidget *parent) : QWidget(parent) {}
|
|
|
|
void SoftwareRenderer::paintEvent(QPaintEvent *event) {
|
|
(void) event;
|
|
|
|
QPainter painter(this);
|
|
painter.drawImage(QRect(0, 0, width(), height()), image, QRect(sx, sy, sw, sh));
|
|
image = QImage();
|
|
}
|
|
|
|
void SoftwareRenderer::onBlit(const QImage& img, int x, int y, int w, int h) {
|
|
image = img;
|
|
sx = x;
|
|
sy = y;
|
|
sw = w;
|
|
sh = h;
|
|
update();
|
|
}
|