mirror of
https://git.eden-emu.dev/eden-emu/eden.git
synced 2025-07-20 18:45:45 +00:00
QT Frontend: Migrate to QOpenGLWindow
This commit is contained in:
parent
3479b85af9
commit
01a3b4f0de
4 changed files with 113 additions and 30 deletions
|
@ -7,9 +7,9 @@
|
|||
#include <atomic>
|
||||
#include <condition_variable>
|
||||
#include <mutex>
|
||||
#include <QGLWidget>
|
||||
#include <QImage>
|
||||
#include <QThread>
|
||||
#include <QWidget>
|
||||
#include "common/thread.h"
|
||||
#include "core/core.h"
|
||||
#include "core/frontend/emu_window.h"
|
||||
|
@ -21,6 +21,8 @@ class QTouchEvent;
|
|||
class GGLWidgetInternal;
|
||||
class GMainWindow;
|
||||
class GRenderWindow;
|
||||
class QSurface;
|
||||
class QOpenGLContext;
|
||||
|
||||
class EmuThread : public QThread {
|
||||
Q_OBJECT
|
||||
|
@ -115,6 +117,7 @@ public:
|
|||
void MakeCurrent() override;
|
||||
void DoneCurrent() override;
|
||||
void PollEvents() override;
|
||||
std::unique_ptr<Core::Frontend::GraphicsContext> CreateSharedContext() const override;
|
||||
|
||||
void BackupGeometry();
|
||||
void RestoreGeometry();
|
||||
|
@ -168,6 +171,11 @@ private:
|
|||
QByteArray geometry;
|
||||
|
||||
EmuThread* emu_thread;
|
||||
// Context that backs the GGLWidgetInternal (and will be used by core to render)
|
||||
std::unique_ptr<QOpenGLContext> context;
|
||||
// Context that will be shared between all newly created contexts. This should never be made
|
||||
// current
|
||||
std::unique_ptr<QOpenGLContext> shared_context;
|
||||
|
||||
/// Temporary storage of the screenshot taken
|
||||
QImage screenshot_image;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue