- if (buffer)
- {
- delete[] buffer;
- glDeleteTextures(1, &texture);
- }
-
- buffer = new uint32_t[textureWidth * textureHeight];
- JaguarSetScreenBuffer(buffer);
-
-//???
-memset(buffer, 0xFF, textureWidth * textureHeight * sizeof(uint32_t));
- glGenTextures(1, &texture);
- glBindTexture(GL_TEXTURE_2D, texture);
- glPixelStorei(GL_UNPACK_ROW_LENGTH, textureWidth);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, textureWidth, textureHeight, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, NULL);
+ return;
+}
+
+
+// At some point, we'll have to create more than one texture to handle
+// cases like Doom. Or have another go at TV type rendering; it will
+// require a 2048x512 texture though. (Note that 512 is the correct height for
+// interlaced screens; we won't have to change much here to support it.)
+void GLWidget::CreateTextures(void)
+{
+ // Seems that power of 2 sizes are still mandatory...
+ textureWidth = 1024;
+ textureHeight = 512;
+ buffer = new uint32_t[textureWidth * textureHeight];
+ JaguarSetScreenBuffer(buffer);
+
+ glGenTextures(1, &texture);
+ glBindTexture(GL_TEXTURE_2D, texture);
+ glPixelStorei(GL_UNPACK_ROW_LENGTH, textureWidth);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, textureWidth, textureHeight, 0, GL_RGBA, GL_UNSIGNED_INT_8_8_8_8, NULL);
+}
+
+
+void GLWidget::HandleMouseHiding(void)
+{
+ // Mouse watchdog timer handling. Basically, if the timeout value is
+ // greater than zero, decrement it. Otherwise, check for zero, if so, then
+ // hide the mouse and set the hideMouseTimeout value to -1 to signal that
+ // the mouse has been hidden.
+ if (hideMouseTimeout > 0)
+ hideMouseTimeout--;
+ else if (hideMouseTimeout == 0)
+ {
+ hideMouseTimeout--;
+ qApp->setOverrideCursor(Qt::BlankCursor);