mirror of
https://github.com/simple64/simple64.git
synced 2026-11-14 21:08:42 +01:00
update gui
This commit is contained in:
1 parent
764a86f899
commit
ac9f7426bc
5 files changed
+22
-2
No files matched your search
@@ -17,5 +17,6 @@ ptr_ConfigGetParamString ConfigGetParamString = nullptr;
|
||||
ptr_ConfigSetParameter ConfigSetParameter = nullptr;
|
||||
ptr_ConfigDeleteSection ConfigDeleteSection = nullptr;
|
||||
ptr_ConfigOpenSection ConfigOpenSection = nullptr;
|
||||
ptr_ConfigSaveSection ConfigSaveSection = nullptr;
|
||||
ptr_ConfigListParameters ConfigListParameters = nullptr;
|
||||
ptr_ConfigGetSharedDataFilepath ConfigGetSharedDataFilepath = nullptr;
|
||||
@@ -21,6 +21,7 @@ extern ptr_ConfigGetParamString ConfigGetParamString;
|
||||
extern ptr_ConfigSetParameter ConfigSetParameter;
|
||||
extern ptr_ConfigDeleteSection ConfigDeleteSection;
|
||||
extern ptr_ConfigOpenSection ConfigOpenSection;
|
||||
extern ptr_ConfigSaveSection ConfigSaveSection;
|
||||
extern ptr_ConfigListParameters ConfigListParameters;
|
||||
extern ptr_ConfigGetSharedDataFilepath ConfigGetSharedDataFilepath;
|
||||
#endif
|
||||
@@ -980,6 +980,7 @@ void MainWindow::loadCoreLib()
|
||||
ConfigSetParameter = (ptr_ConfigSetParameter) osal_dynlib_getproc(coreLib, "ConfigSetParameter");
|
||||
ConfigDeleteSection = (ptr_ConfigDeleteSection) osal_dynlib_getproc(coreLib, "ConfigDeleteSection");
|
||||
ConfigOpenSection = (ptr_ConfigOpenSection) osal_dynlib_getproc(coreLib, "ConfigOpenSection");
|
||||
ConfigSaveSection = (ptr_ConfigSaveSection) osal_dynlib_getproc(coreLib, "ConfigSaveSection");
|
||||
ConfigListParameters = (ptr_ConfigListParameters) osal_dynlib_getproc(coreLib, "ConfigListParameters");
|
||||
ConfigGetSharedDataFilepath = (ptr_ConfigGetSharedDataFilepath) osal_dynlib_getproc(coreLib, "ConfigGetSharedDataFilepath");
|
||||
|
||||
|
||||
@@ -9,6 +9,18 @@ VkWindow::VkWindow(QWindow *parent)
|
||||
setSurfaceType(QWindow::VulkanSurface);
|
||||
}
|
||||
|
||||
VkWindow::~VkWindow()
|
||||
{
|
||||
if (w->getCoreLib())
|
||||
{
|
||||
m64p_handle configVideoParallel = NULL;
|
||||
(*ConfigOpenSection)("Video-Parallel", &configVideoParallel);
|
||||
(*ConfigSetParameter)(configVideoParallel, "ScreenWidth", M64TYPE_INT, &orig_width);
|
||||
(*ConfigSetParameter)(configVideoParallel, "ScreenHeight", M64TYPE_INT, &orig_height);
|
||||
(*ConfigSaveSection)("Video-Parallel");
|
||||
}
|
||||
}
|
||||
|
||||
void VkWindow::resizeEvent(QResizeEvent *event) {
|
||||
QWindow::resizeEvent(event);
|
||||
if (timerId) {
|
||||
@@ -16,8 +28,10 @@ void VkWindow::resizeEvent(QResizeEvent *event) {
|
||||
timerId = 0;
|
||||
}
|
||||
timerId = startTimer(500);
|
||||
m_width = event->size().width() * devicePixelRatio();
|
||||
m_height = event->size().height() * devicePixelRatio();
|
||||
orig_width = event->size().width();
|
||||
orig_height = event->size().height();
|
||||
m_width = orig_width * devicePixelRatio();
|
||||
m_height = orig_height * devicePixelRatio();
|
||||
}
|
||||
|
||||
void VkWindow::timerEvent(QTimerEvent *te) {
|
||||
|
||||
@@ -10,6 +10,7 @@ class VkWindow : public QWindow
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit VkWindow(QWindow *parent = nullptr);
|
||||
~VkWindow();
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent *event) Q_DECL_OVERRIDE;
|
||||
|
||||
@@ -17,6 +18,8 @@ protected:
|
||||
private:
|
||||
int m_width;
|
||||
int m_height;
|
||||
int orig_width;
|
||||
int orig_height;
|
||||
int timerId = 0;
|
||||
};
|
||||
#endif // VKWINDOW_H
|
||||
Reference in new issue
Block a user