qt: try another way
This commit is contained in:
@@ -46,7 +46,9 @@ void HardwareRenderer::initializeGL()
|
|||||||
{
|
{
|
||||||
m_context->makeCurrent(this);
|
m_context->makeCurrent(this);
|
||||||
initializeOpenGLFunctions();
|
initializeOpenGLFunctions();
|
||||||
m_texture = new QOpenGLTexture(QImage(2048,2048, QImage::Format::Format_RGB32));
|
auto image = QImage(2048, 2048, QImage::Format_RGB32);
|
||||||
|
image.fill(0xff000000);
|
||||||
|
m_texture = new QOpenGLTexture(image);
|
||||||
m_blt = new QOpenGLTextureBlitter;
|
m_blt = new QOpenGLTextureBlitter;
|
||||||
m_blt->setRedBlueSwizzle(true);
|
m_blt->setRedBlueSwizzle(true);
|
||||||
m_blt->create();
|
m_blt->create();
|
||||||
@@ -138,6 +140,7 @@ void HardwareRenderer::initializeGL()
|
|||||||
pclog("OpenGL shader language version: %s\n", glGetString(GL_SHADING_LANGUAGE_VERSION));
|
pclog("OpenGL shader language version: %s\n", glGetString(GL_SHADING_LANGUAGE_VERSION));
|
||||||
glClearColor(0, 0, 0, 1);
|
glClearColor(0, 0, 0, 1);
|
||||||
m_texture->setWrapMode(QOpenGLTexture::ClampToEdge);
|
m_texture->setWrapMode(QOpenGLTexture::ClampToEdge);
|
||||||
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
void HardwareRenderer::paintGL() {
|
void HardwareRenderer::paintGL() {
|
||||||
|
@@ -507,15 +507,6 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||||||
#endif
|
#endif
|
||||||
if (!vnc_enabled) video_setblit(qt_blit);
|
if (!vnc_enabled) video_setblit(qt_blit);
|
||||||
|
|
||||||
if (start_in_fullscreen) {
|
|
||||||
connect(ui->stackedWidget, &RendererStack::blit, this, [this] () {
|
|
||||||
if (start_in_fullscreen) {
|
|
||||||
QTimer::singleShot(100, ui->actionFullscreen, &QAction::trigger);
|
|
||||||
start_in_fullscreen = 0;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifdef MTR_ENABLED
|
#ifdef MTR_ENABLED
|
||||||
{
|
{
|
||||||
ui->actionBegin_trace->setVisible(true);
|
ui->actionBegin_trace->setVisible(true);
|
||||||
@@ -711,6 +702,10 @@ void MainWindow::showEvent(QShowEvent *event) {
|
|||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
this->adjustSize();
|
this->adjustSize();
|
||||||
}
|
}
|
||||||
|
if (start_in_fullscreen) {
|
||||||
|
start_in_fullscreen = 0;
|
||||||
|
QTimer::singleShot(0, ui->actionFullscreen, &QAction::trigger);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::on_actionKeyboard_requires_capture_triggered() {
|
void MainWindow::on_actionKeyboard_requires_capture_triggered() {
|
||||||
|
@@ -14,6 +14,7 @@
|
|||||||
* Copyright 2022 Teemu Korhonen
|
* Copyright 2022 Teemu Korhonen
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <GL/gl.h>
|
||||||
#include <QCoreApplication>
|
#include <QCoreApplication>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QOpenGLShaderProgram>
|
#include <QOpenGLShaderProgram>
|
||||||
@@ -194,6 +195,9 @@ OpenGLRenderer::initialize()
|
|||||||
|
|
||||||
emit initialized();
|
emit initialized();
|
||||||
|
|
||||||
|
glClear(GL_COLOR_BUFFER_BIT);
|
||||||
|
|
||||||
|
context->swapBuffers(this);
|
||||||
} catch (const opengl_init_error &e) {
|
} catch (const opengl_init_error &e) {
|
||||||
/* Mark all buffers as in use */
|
/* Mark all buffers as in use */
|
||||||
for (auto &flag : buf_usage)
|
for (auto &flag : buf_usage)
|
||||||
|
@@ -416,6 +416,7 @@ RendererStack::createRenderer(Renderer renderer)
|
|||||||
current->setFocusPolicy(Qt::NoFocus);
|
current->setFocusPolicy(Qt::NoFocus);
|
||||||
current->setFocusProxy(this);
|
current->setFocusProxy(this);
|
||||||
current->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
current->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
|
||||||
|
current->setStyleSheet("background-color: black");
|
||||||
addWidget(current.get());
|
addWidget(current.get());
|
||||||
|
|
||||||
this->setStyleSheet("background-color: black");
|
this->setStyleSheet("background-color: black");
|
||||||
|
Reference in New Issue
Block a user