#include "glwidget.h"
+#include "jaguar.h"
#include "settings.h"
#include "tom.h"
-#include "video.h"
+
+#ifdef __GCCWIN32__
+// Apparently on win32, various OpenGL constants aren't pulled in.
+#include <GL/glext.h>
+#endif
GLWidget::GLWidget(QWidget * parent/*= 0*/): QGLWidget(parent), texture(0),
textureWidth(0), textureHeight(0), buffer(0), rasterWidth(320), rasterHeight(240)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, (vjs.glFilter ? GL_LINEAR : GL_NEAREST));
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, (vjs.glFilter ? GL_LINEAR : GL_NEAREST));
// glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, rasterWidth, rasterHeight, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV, buffer);
- glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, rasterWidth, rasterHeight, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, buffer);
+//more kludge
+ glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, TOMGetVideoModeWidth(), rasterHeight, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, buffer);
+// glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, rasterWidth, rasterHeight, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, buffer);
- double w = (double)rasterWidth / (double)textureWidth;
+ double w = (double)TOMGetVideoModeWidth() / (double)textureWidth;
+// double w = (double)rasterWidth / (double)textureWidth;
double h = (double)rasterHeight / (double)textureHeight;
unsigned u = outputWidth;
unsigned v = outputHeight;
}
buffer = new uint32_t[textureWidth * textureHeight];
+//???
+memset(buffer, 0x00, textureWidth * textureHeight * sizeof(uint32_t));
glGenTextures(1, &texture);
glBindTexture(GL_TEXTURE_2D, texture);
glPixelStorei(GL_UNPACK_ROW_LENGTH, textureWidth);