fix things

This commit is contained in:
Arisotura 2020-05-28 22:37:37 +02:00
parent b7946c1384
commit 590ab2ac2b
2 changed files with 13 additions and 12 deletions

View File

@ -7,7 +7,10 @@ SET(SOURCES_QT_SDL
InputConfigDialog.cpp
VideoSettingsDialog.cpp
AudioSettingsDialog.cpp
WifiSettingsDialog.cpp
Input.cpp
LAN_PCap.cpp
LAN_Socket.cpp
OSD.cpp
OSD_shaders.h
font.h
@ -40,6 +43,7 @@ pkg_check_modules(SDL2 REQUIRED sdl2)
add_executable(melonDS ${SOURCES_QT_SDL})
target_include_directories(melonDS PRIVATE ${SDL2_INCLUDE_DIRS})
target_include_directories(melonDS PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
target_include_directories(melonDS PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/..")
target_include_directories(melonDS PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/../..")
target_link_libraries(melonDS core ${SDL2_LIBRARIES})

View File

@ -38,6 +38,7 @@
#include "InputConfigDialog.h"
#include "VideoSettingsDialog.h"
#include "AudioSettingsDialog.h"
#include "WifiSettingsDialog.h"
#include "types.h"
#include "version.h"
@ -298,9 +299,10 @@ void EmuThread::initOpenGL()
oglContext->moveToThread(this);
}
void deinitOpenGL()
void EmuThread::deinitOpenGL()
{
// TODO!!
delete oglContext;
delete oglSurface;
}
void* oglGetProcAddress(const char* proc)
@ -545,16 +547,11 @@ void EmuThread::run()
NDS::DeInit();
//Platform::LAN_DeInit();
/*if (Screen_UseGL)
{
OSD::DeInit(true);
GLScreen_DeInit();
}
else
OSD::DeInit(false);*/
if (hasOGL)
{
oglContext->doneCurrent();
deinitOpenGL();
}
}
void EmuThread::changeWindowTitle(char* title)
@ -844,7 +841,6 @@ void ScreenPanelGL::initializeGL()
screenShader->addShaderFromSourceCode(QOpenGLShader::Fragment, kScreenFS);
GLuint pid = screenShader->programId();
printf("program: %d\n", pid);
glBindAttribLocation(pid, 0, "vPosition");
glBindAttribLocation(pid, 1, "vTexcoord");
glBindFragDataLocation(pid, 0, "oColor");
@ -1675,7 +1671,7 @@ void MainWindow::onAudioSettingsFinished(int res)
void MainWindow::onOpenWifiSettings()
{
//
WifiSettingsDialog::openDlg(this);
}
void MainWindow::onChangeSavestateSRAMReloc(bool checked)
@ -1822,6 +1818,7 @@ void MainWindow::onUpdateVideoSettings(bool glchange)
{
emuThread->emuPause();
if (hasOGL) emuThread->deinitOpenGL();
delete panel;
createScreenPanel();
connect(emuThread, SIGNAL(windowUpdate()), panel, SLOT(update()));