mirror of
https://github.com/simple64/simple64.git
synced 2026-09-11 06:42:44 +02:00
29 lines
693 B
C++
29 lines
693 B
C++
|
|
#include "oglwindow.h"
|
|
extern QThread* rendering_thread;
|
|
|
|
void OGLWindow::initializeGL() {
|
|
doneCurrent();
|
|
context()->moveToThread(rendering_thread);
|
|
}
|
|
|
|
void OGLWindow::resizeEvent(QResizeEvent *event) {
|
|
QOpenGLWindow::resizeEvent(event);
|
|
if (timerId) {
|
|
killTimer(timerId);
|
|
timerId = 0;
|
|
}
|
|
timerId = startTimer(500);
|
|
m_width = event->size().width();
|
|
m_height = event->size().height();
|
|
}
|
|
|
|
void OGLWindow::timerEvent(QTimerEvent *te) {
|
|
int size = (m_width << 16) + m_height;
|
|
if (coreStarted)
|
|
(*CoreDoCommand)(M64CMD_CORE_STATE_SET, M64CORE_VIDEO_SIZE, &size);
|
|
killTimer(te->timerId());
|
|
timerId = 0;
|
|
requestActivate();
|
|
}
|