From 893176a0b18a2281abe09def716ccc3db5583c3f Mon Sep 17 00:00:00 2001 From: Julian T Date: Sun, 26 Jul 2020 12:56:27 +0200 Subject: Implemented object intersection and startet work on render gui --- app/draw.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 app/draw.cpp (limited to 'app/draw.cpp') diff --git a/app/draw.cpp b/app/draw.cpp new file mode 100644 index 0000000..2f3a947 --- /dev/null +++ b/app/draw.cpp @@ -0,0 +1,24 @@ +#include "draw.hpp" +#include +#include +#include +#include +#include +#include + +DrawWidget::DrawWidget(unsigned width, unsigned height) : QWidget() { + m_width = width; + m_height = height; + m_drawbuffer = new QRgb[width * height]; + + m_img = QImage((uchar*)m_drawbuffer, width, height, QImage::Format_ARGB32); +} + +void DrawWidget::paintEvent(QPaintEvent*) { + QPainter painter(this); + painter.drawImage(0, 0, m_img); +} + +DrawWidget::~DrawWidget() { + delete[] m_drawbuffer; +} -- cgit v1.2.3