mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-25 23:29:55 -06:00

* WIP: use Duckstation's context code to directly render into QT Widget from separate thread without two OpenGL contexts currently only works on Windows * reenable gay OSD * add back vsync * make it atleast a little more thread safe * linux support * don't segfault on closing * reorganise and cleanup build system it's still not good, but better than before * macos? * try to get it working on Ubuntu CI also update instructions * let's try this * ok how about this * try creating an OGL 4.3 context first (https://i.kym-cdn.com/photos/images/original/001/264/842/220.png) * fix Ubuntu * hm * try again for Windows * let's try this * make the OpenGL renderer work again that was stupid * do OGL surface resizing from the mainthread * Fix small mistake in GL context creation on macOS causing version 3.2 to be considered invalid * C stupidness * cleanup * don't let the emuthread deinit OGL if there's no OGL * reset lastScreenWidth/Height when deiniting OpenGL * disable stencil test while drawing framebuffers * macOS: Link Cocoa framework explicitly when not building with Qt6 Seems to be needed for the classes used by DuckStation's GL context code. * Set ScreenPanelGL's minimum size immediately Fixes GL context creation for OpenGL display on macOS using the wrong size as the underlying window was not resized to the correct size by Qt yet. * don't emit window updates when OGL display is used * stuff Arisotura said Co-authored-by: Nadia Holmquist Pedersen <nadia@nhp.sh>
88 lines
2.2 KiB
C++
88 lines
2.2 KiB
C++
/*
|
|
Copyright 2016-2022 melonDS team
|
|
|
|
This file is part of melonDS.
|
|
|
|
melonDS is free software: you can redistribute it and/or modify it under
|
|
the terms of the GNU General Public License as published by the Free
|
|
Software Foundation, either version 3 of the License, or (at your option)
|
|
any later version.
|
|
|
|
melonDS is distributed in the hope that it will be useful, but WITHOUT ANY
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
|
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
|
|
|
You should have received a copy of the GNU General Public License along
|
|
with melonDS. If not, see http://www.gnu.org/licenses/.
|
|
*/
|
|
|
|
#ifndef VIDEOSETTINGSDIALOG_H
|
|
#define VIDEOSETTINGSDIALOG_H
|
|
|
|
#include <QDialog>
|
|
#include <QButtonGroup>
|
|
|
|
namespace Ui { class VideoSettingsDialog; }
|
|
class VideoSettingsDialog;
|
|
|
|
class VideoSettingsDialog : public QDialog
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit VideoSettingsDialog(QWidget* parent);
|
|
~VideoSettingsDialog();
|
|
|
|
static VideoSettingsDialog* currentDlg;
|
|
static VideoSettingsDialog* openDlg(QWidget* parent)
|
|
{
|
|
if (currentDlg)
|
|
{
|
|
currentDlg->activateWindow();
|
|
return currentDlg;
|
|
}
|
|
|
|
currentDlg = new VideoSettingsDialog(parent);
|
|
currentDlg->show();
|
|
return currentDlg;
|
|
}
|
|
static void closeDlg()
|
|
{
|
|
currentDlg = nullptr;
|
|
}
|
|
|
|
signals:
|
|
void updateVideoSettings(bool glchange);
|
|
|
|
private slots:
|
|
void on_VideoSettingsDialog_accepted();
|
|
void on_VideoSettingsDialog_rejected();
|
|
|
|
void onChange3DRenderer(int renderer);
|
|
void on_cbGLDisplay_stateChanged(int state);
|
|
void on_cbVSync_stateChanged(int state);
|
|
void on_sbVSyncInterval_valueChanged(int val);
|
|
|
|
void on_cbxGLResolution_currentIndexChanged(int idx);
|
|
void on_cbBetterPolygons_stateChanged(int state);
|
|
|
|
void on_cbSoftwareThreaded_stateChanged(int state);
|
|
private:
|
|
void setVsyncControlEnable(bool hasOGL);
|
|
|
|
Ui::VideoSettingsDialog* ui;
|
|
|
|
QButtonGroup* grp3DRenderer;
|
|
|
|
int oldRenderer;
|
|
int oldGLDisplay;
|
|
int oldVSync;
|
|
int oldVSyncInterval;
|
|
int oldSoftThreaded;
|
|
int oldGLScale;
|
|
int oldGLBetterPolygons;
|
|
};
|
|
|
|
#endif // VIDEOSETTINGSDIALOG_H
|
|
|