X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fgui%2Fglwidget.cpp;h=9788bc3b4f65e53cc6cd5fb039e01f3ee827b59d;hb=438d3a52ef0af04ac3279c0839fe6ffd7333b776;hp=d4a65ec59568986c4555ad9cbe767bbbba9692ef;hpb=5e11cea96160bd958c1b271940bf97ecfa257b15;p=virtualjaguar diff --git a/src/gui/glwidget.cpp b/src/gui/glwidget.cpp index d4a65ec..9788bc3 100644 --- a/src/gui/glwidget.cpp +++ b/src/gui/glwidget.cpp @@ -14,15 +14,27 @@ #include "glwidget.h" #include "settings.h" +#include "tom.h" +#include "video.h" GLWidget::GLWidget(QWidget * parent/*= 0*/): QGLWidget(parent), texture(0), - textureWidth(0), textureHeight(0), buffer(0), rasterWidth(64), rasterHeight(64) -// textureWidth(0), textureHeight(0), buffer(0), rasterWidth(256), rasterHeight(256) + textureWidth(0), textureHeight(0), buffer(0), rasterWidth(320), rasterHeight(240) { +// tomDeviceWidth = rasterWidth; + tomDeviceWidth = 1024; // It has to be the texture width... + + // Set up the backbuffer + // To be safe, this should be 1280 * 625 * 2... + backbuffer = (uint32_t *)malloc(1280 * 625 * sizeof(uint32_t)); +// memset(backbuffer, 0x44, rasterWidth * + memset(backbuffer, 0xFF, 1024 * + (vjs.hardwareTypeNTSC ? rasterHeight : VIRTUAL_SCREEN_HEIGHT_PAL) + * sizeof(uint32_t)); } GLWidget::~GLWidget() { + delete[] backbuffer; } void GLWidget::initializeGL() @@ -42,6 +54,9 @@ void GLWidget::initializeGL() void GLWidget::paintGL() { +//kludge +rasterHeight = (vjs.hardwareTypeNTSC ? 240 : 256); + unsigned outputWidth = width(); unsigned outputHeight = height();