Merge pull request #1467 from waddlesplash/dolphin-qt
DolphinQt: Games now boot!
This commit is contained in:
commit
890b788633
|
@ -14,7 +14,7 @@ set(SRCS
|
||||||
SystemInfo.cpp
|
SystemInfo.cpp
|
||||||
Utils/Resources.cpp
|
Utils/Resources.cpp
|
||||||
Utils/Utils.cpp
|
Utils/Utils.cpp
|
||||||
VideoInterface/VideoInterface.cpp
|
VideoInterface/RenderWidget.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set(UIS
|
set(UIS
|
||||||
|
|
|
@ -48,6 +48,9 @@
|
||||||
<AdditionalLibraryDirectories>$(ExternalsDir)OpenAL\$(PlatformName);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
<AdditionalLibraryDirectories>$(ExternalsDir)OpenAL\$(PlatformName);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||||
<AdditionalDependencies>iphlpapi.lib;winmm.lib;setupapi.lib;vfw32.lib;opengl32.lib;glu32.lib;rpcrt4.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
<AdditionalDependencies>iphlpapi.lib;winmm.lib;setupapi.lib;vfw32.lib;opengl32.lib;glu32.lib;rpcrt4.lib;comctl32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
</Link>
|
</Link>
|
||||||
|
<ClCompile>
|
||||||
|
<AdditionalIncludeDirectories>$(ProjectDir)\VideoInterface;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
</ClCompile>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<!--QRC and UI files are handled automatically-->
|
<!--QRC and UI files are handled automatically-->
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
@ -62,16 +65,18 @@
|
||||||
<QtMoc Include="AboutDialog.h" />
|
<QtMoc Include="AboutDialog.h" />
|
||||||
<QtMoc Include="MainWindow.h" />
|
<QtMoc Include="MainWindow.h" />
|
||||||
<QtMoc Include="SystemInfo.h" />
|
<QtMoc Include="SystemInfo.h" />
|
||||||
|
<QtMoc Include="VideoInterface\RenderWidget.h" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<!--TODO figure out how to get QtMoc to add outputs to ClCompile's inputs...-->
|
<!--TODO figure out how to get QtMoc to add outputs to ClCompile's inputs...-->
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="$(QtMocOutPrefix)AboutDialog.cpp" />
|
<ClCompile Include="$(QtMocOutPrefix)AboutDialog.cpp" />
|
||||||
<ClCompile Include="$(QtMocOutPrefix)MainWindow.cpp" />
|
<ClCompile Include="$(QtMocOutPrefix)MainWindow.cpp" />
|
||||||
<ClCompile Include="$(QtMocOutPrefix)SystemInfo.cpp" />
|
<ClCompile Include="$(QtMocOutPrefix)SystemInfo.cpp" />
|
||||||
|
<ClCompile Include="$(QtMocOutPrefix)RenderWidget.cpp" />
|
||||||
<ClCompile Include="SystemInfo.cpp" />
|
<ClCompile Include="SystemInfo.cpp" />
|
||||||
<ClCompile Include="Utils\Resources.cpp" />
|
<ClCompile Include="Utils\Resources.cpp" />
|
||||||
<ClCompile Include="Utils\Utils.cpp" />
|
<ClCompile Include="Utils\Utils.cpp" />
|
||||||
<ClCompile Include="VideoInterface\VideoInterface.cpp" />
|
<ClCompile Include="VideoInterface\RenderWidget.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="AboutDialog.cpp" />
|
<ClCompile Include="AboutDialog.cpp" />
|
||||||
|
@ -152,6 +157,7 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="Utils\Resources.h" />
|
<ClInclude Include="Utils\Resources.h" />
|
||||||
<ClInclude Include="Utils\Utils.h" />
|
<ClInclude Include="Utils\Utils.h" />
|
||||||
|
<ClInclude Include="VideoInterface\RenderWidget.h" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<!--Disable copying to binary dir for now on the buildbot to prevent packaging of the outputs-->
|
<!--Disable copying to binary dir for now on the buildbot to prevent packaging of the outputs-->
|
||||||
<Target Name="AfterBuild" Inputs="@(AllInputFiles)" Outputs="@(AllInputFiles -> '$(BinaryOutputDir)%(RecursiveDir)%(Filename)%(Extension)')" Condition="'$(I_AM_BUILDACUS)'==''">
|
<Target Name="AfterBuild" Inputs="@(AllInputFiles)" Outputs="@(AllInputFiles -> '$(BinaryOutputDir)%(RecursiveDir)%(Filename)%(Extension)')" Condition="'$(I_AM_BUILDACUS)'==''">
|
||||||
|
|
|
@ -5,9 +5,6 @@
|
||||||
<ClCompile Include="Host.cpp" />
|
<ClCompile Include="Host.cpp" />
|
||||||
<ClCompile Include="Main.cpp" />
|
<ClCompile Include="Main.cpp" />
|
||||||
<ClCompile Include="MainWindow.cpp" />
|
<ClCompile Include="MainWindow.cpp" />
|
||||||
<ClCompile Include="VideoInterface\VideoInterface.cpp">
|
|
||||||
<Filter>VideoInterface</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="Utils\Resources.cpp">
|
<ClCompile Include="Utils\Resources.cpp">
|
||||||
<Filter>Utils</Filter>
|
<Filter>Utils</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
@ -15,11 +12,27 @@
|
||||||
<Filter>Utils</Filter>
|
<Filter>Utils</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="SystemInfo.cpp" />
|
<ClCompile Include="SystemInfo.cpp" />
|
||||||
|
<ClCompile Include="VideoInterface\RenderWidget.cpp">
|
||||||
|
<Filter>VideoInterface</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(QtMocOutPrefix)AboutDialog.cpp">
|
||||||
|
<Filter>Generated Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(QtMocOutPrefix)MainWindow.cpp">
|
||||||
|
<Filter>Generated Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(QtMocOutPrefix)RenderWidget.cpp">
|
||||||
|
<Filter>Generated Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="$(QtMocOutPrefix)SystemInfo.cpp">
|
||||||
|
<Filter>Generated Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<QtMoc Include="AboutDialog.h" />
|
<QtMoc Include="AboutDialog.h" />
|
||||||
<QtMoc Include="MainWindow.h" />
|
<QtMoc Include="MainWindow.h" />
|
||||||
<QtMoc Include="SystemInfo.h" />
|
<QtMoc Include="SystemInfo.h" />
|
||||||
|
<QtMoc Include="VideoInterface\RenderWidget.h" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<QtUi Include="*.ui" />
|
<QtUi Include="*.ui" />
|
||||||
|
@ -34,6 +47,9 @@
|
||||||
<Filter Include="Utils">
|
<Filter Include="Utils">
|
||||||
<UniqueIdentifier>{730f2ae7-a686-4bc8-bb49-b4f8bd240329}</UniqueIdentifier>
|
<UniqueIdentifier>{730f2ae7-a686-4bc8-bb49-b4f8bd240329}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<Filter Include="Generated Files">
|
||||||
|
<UniqueIdentifier>{c18a1fb3-64ff-4249-b808-d73a56ea3a2d}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="Utils\Resources.h">
|
<ClInclude Include="Utils\Resources.h">
|
||||||
|
@ -42,5 +58,8 @@
|
||||||
<ClInclude Include="Utils\Utils.h">
|
<ClInclude Include="Utils\Utils.h">
|
||||||
<Filter>Utils</Filter>
|
<Filter>Utils</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="VideoInterface\RenderWidget.h">
|
||||||
|
<Filter>VideoInterface</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
|
@ -5,9 +5,14 @@
|
||||||
#include <cstdarg>
|
#include <cstdarg>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
|
#include <QApplication>
|
||||||
|
#include <QResizeEvent>
|
||||||
|
|
||||||
#include "Common/MsgHandler.h"
|
#include "Common/MsgHandler.h"
|
||||||
#include "Core/Host.h"
|
#include "Core/Host.h"
|
||||||
|
|
||||||
|
#include "DolphinQt/MainWindow.h"
|
||||||
|
|
||||||
void Host_SysMessage(const char *fmt, ...)
|
void Host_SysMessage(const char *fmt, ...)
|
||||||
{
|
{
|
||||||
va_list list;
|
va_list list;
|
||||||
|
@ -27,9 +32,48 @@ void Host_Message(int id)
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Host_UpdateMainFrame()
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
|
void Host_UpdateTitle(const std::string& title)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
|
||||||
void* Host_GetRenderHandle()
|
void* Host_GetRenderHandle()
|
||||||
{
|
{
|
||||||
return nullptr;
|
return (void*)(g_main_window->GetRenderWidget()->winId());
|
||||||
|
}
|
||||||
|
|
||||||
|
void Host_GetRenderWindowSize(int& x, int& y, int& w, int& h)
|
||||||
|
{
|
||||||
|
// TODO: Make it more clear what this is supposed to return.. i.e. WX always sets x=y=0
|
||||||
|
g_main_window->RenderWidgetSize(x, y, w, h);
|
||||||
|
x = 0;
|
||||||
|
y = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Host_RequestRenderWindowSize(int w, int h)
|
||||||
|
{
|
||||||
|
DRenderWidget* render_widget = g_main_window->GetRenderWidget();
|
||||||
|
qApp->postEvent(render_widget, new QResizeEvent(QSize(w, h), render_widget->size()));
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Host_RendererHasFocus()
|
||||||
|
{
|
||||||
|
return g_main_window->RenderWidgetHasFocus();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Host_UIHasFocus()
|
||||||
|
{
|
||||||
|
return g_main_window->isActiveWindow();
|
||||||
|
}
|
||||||
|
|
||||||
|
void Host_RequestFullscreen(bool enable)
|
||||||
|
{
|
||||||
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
void Host_NotifyMapLoaded()
|
void Host_NotifyMapLoaded()
|
||||||
|
@ -42,31 +86,6 @@ void Host_UpdateDisasmDialog()
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
void Host_UpdateMainFrame()
|
|
||||||
{
|
|
||||||
// TODO
|
|
||||||
}
|
|
||||||
|
|
||||||
void Host_UpdateTitle(const std::string& title)
|
|
||||||
{
|
|
||||||
// TODO
|
|
||||||
}
|
|
||||||
|
|
||||||
void Host_GetRenderWindowSize(int& x, int& y, int& width, int& height)
|
|
||||||
{
|
|
||||||
// TODO
|
|
||||||
}
|
|
||||||
|
|
||||||
void Host_RequestRenderWindowSize(int width, int height)
|
|
||||||
{
|
|
||||||
// TODO
|
|
||||||
}
|
|
||||||
|
|
||||||
void Host_RequestFullscreen(bool enable_fullscreen)
|
|
||||||
{
|
|
||||||
// TODO
|
|
||||||
}
|
|
||||||
|
|
||||||
void Host_SetStartupDebuggingParameters()
|
void Host_SetStartupDebuggingParameters()
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
|
@ -77,18 +96,6 @@ void Host_SetWiiMoteConnectionState(int state)
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Host_UIHasFocus()
|
|
||||||
{
|
|
||||||
// TODO
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Host_RendererHasFocus()
|
|
||||||
{
|
|
||||||
// TODO
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Host_ConnectWiimote(int wm_idx, bool connect)
|
void Host_ConnectWiimote(int wm_idx, bool connect)
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
|
|
|
@ -54,10 +54,11 @@ int main(int argc, char* argv[])
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
DMainWindow w;
|
g_main_window = new DMainWindow();
|
||||||
w.show();
|
g_main_window->show();
|
||||||
|
|
||||||
int retcode = app.exec();
|
int retcode = app.exec();
|
||||||
|
delete g_main_window;
|
||||||
UICommon::Shutdown();
|
UICommon::Shutdown();
|
||||||
return retcode;
|
return retcode;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,36 +3,247 @@
|
||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
|
#include <QFileDialog>
|
||||||
|
#include <QMessageBox>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
|
||||||
#include "ui_MainWindow.h"
|
#include "ui_MainWindow.h"
|
||||||
|
|
||||||
#include "Common/StdMakeUnique.h"
|
#include "Common/StdMakeUnique.h"
|
||||||
|
|
||||||
|
#include "Core/BootManager.h"
|
||||||
|
#include "Core/ConfigManager.h"
|
||||||
|
|
||||||
#include "DolphinQt/AboutDialog.h"
|
#include "DolphinQt/AboutDialog.h"
|
||||||
#include "DolphinQt/MainWindow.h"
|
#include "DolphinQt/MainWindow.h"
|
||||||
#include "DolphinQt/SystemInfo.h"
|
#include "DolphinQt/SystemInfo.h"
|
||||||
#include "DolphinQt/Utils/Resources.h"
|
#include "DolphinQt/Utils/Resources.h"
|
||||||
#include "DolphinQt/Utils/Utils.h"
|
#include "DolphinQt/Utils/Utils.h"
|
||||||
|
|
||||||
|
// The "g_main_window" object as defined in MainWindow.h
|
||||||
|
DMainWindow* g_main_window = nullptr;
|
||||||
|
|
||||||
DMainWindow::DMainWindow(QWidget* parent_widget)
|
DMainWindow::DMainWindow(QWidget* parent_widget)
|
||||||
: QMainWindow(parent_widget)
|
: QMainWindow(parent_widget)
|
||||||
{
|
{
|
||||||
m_ui = std::make_unique<Ui::DMainWindow>();
|
m_ui = std::make_unique<Ui::DMainWindow>();
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
|
|
||||||
Resources::Init();
|
|
||||||
m_ui->actOpen->setIcon(Resources::GetIcon(Resources::TOOLBAR_OPEN));
|
|
||||||
|
|
||||||
#ifdef Q_OS_MACX
|
#ifdef Q_OS_MACX
|
||||||
m_ui->toolbar->setMovable(false);
|
m_ui->toolbar->setMovable(false);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Resources::Init();
|
||||||
|
|
||||||
|
UpdateIcons();
|
||||||
|
setWindowIcon(Resources::GetIcon(Resources::DOLPHIN_LOGO));
|
||||||
|
|
||||||
|
connect(this, SIGNAL(CoreStateChanged(Core::EState)), this, SLOT(OnCoreStateChanged(Core::EState)));
|
||||||
|
emit CoreStateChanged(Core::CORE_UNINITIALIZED); // update GUI items
|
||||||
}
|
}
|
||||||
|
|
||||||
DMainWindow::~DMainWindow()
|
DMainWindow::~DMainWindow()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Emulation
|
||||||
|
|
||||||
|
void DMainWindow::StartGame(const QString filename)
|
||||||
|
{
|
||||||
|
m_render_widget = std::make_unique<DRenderWidget>();
|
||||||
|
m_render_widget->setWindowTitle(tr("Dolphin")); // TODO
|
||||||
|
m_render_widget->setWindowIcon(windowIcon());
|
||||||
|
|
||||||
|
// TODO: When rendering to main, this won't resize the parent window..
|
||||||
|
if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain)
|
||||||
|
{
|
||||||
|
connect(m_render_widget.get(), SIGNAL(Closed()), this, SLOT(on_actStop_triggered()));
|
||||||
|
m_render_widget->move(SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowXPos,
|
||||||
|
SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowYPos);
|
||||||
|
m_render_widget->resize(SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowWidth, // TODO: Make sure these are client sizes!
|
||||||
|
SConfig::GetInstance().m_LocalCoreStartupParameter.iRenderWindowHeight);
|
||||||
|
m_render_widget->show();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_ui->centralWidget->addWidget(m_render_widget.get());
|
||||||
|
m_ui->centralWidget->setCurrentWidget(m_render_widget.get());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!BootManager::BootCore(filename.toStdString()))
|
||||||
|
{
|
||||||
|
QMessageBox::critical(this, tr("Fatal error"), tr("Failed to init Core"), QMessageBox::Ok);
|
||||||
|
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain)
|
||||||
|
m_ui->centralWidget->removeWidget(m_render_widget.get());
|
||||||
|
else
|
||||||
|
m_render_widget->close();
|
||||||
|
m_render_widget.reset();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// TODO: Disable screensaver!
|
||||||
|
|
||||||
|
// TODO: Fullscreen
|
||||||
|
//DoFullscreen(SConfig::GetInstance().m_LocalCoreStartupParameter.bFullscreen);
|
||||||
|
|
||||||
|
m_render_widget->focusWidget();
|
||||||
|
emit CoreStateChanged(Core::CORE_RUN);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QString DMainWindow::RequestBootFilename()
|
||||||
|
{
|
||||||
|
// If a game is already selected, just return the filename
|
||||||
|
// ... TODO
|
||||||
|
|
||||||
|
return ShowFileDialog();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString DMainWindow::ShowFileDialog()
|
||||||
|
{
|
||||||
|
return QFileDialog::getOpenFileName(this, tr("Open File"), QString(),
|
||||||
|
tr("All supported ROMs (%1);;All files (*)")
|
||||||
|
.arg(SL("*.gcm *.iso *.ciso *.gcz *.wbfs *.elf *.dol *.dff *.tmd *.wad")));
|
||||||
|
}
|
||||||
|
|
||||||
|
void DMainWindow::DoStartPause()
|
||||||
|
{
|
||||||
|
if (Core::GetState() == Core::CORE_RUN)
|
||||||
|
{
|
||||||
|
Core::SetState(Core::CORE_PAUSE);
|
||||||
|
emit CoreStateChanged(Core::CORE_PAUSE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Core::SetState(Core::CORE_RUN);
|
||||||
|
emit CoreStateChanged(Core::CORE_RUN);
|
||||||
|
}
|
||||||
|
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor)
|
||||||
|
m_render_widget->setCursor(Qt::BlankCursor);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DMainWindow::on_actOpen_triggered()
|
||||||
|
{
|
||||||
|
StartGame(ShowFileDialog());
|
||||||
|
}
|
||||||
|
|
||||||
|
void DMainWindow::on_actPlay_triggered()
|
||||||
|
{
|
||||||
|
if (Core::GetState() != Core::CORE_UNINITIALIZED)
|
||||||
|
{
|
||||||
|
DoStartPause();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// initialize Core and boot the game
|
||||||
|
QString filename = RequestBootFilename();
|
||||||
|
if (!filename.isNull())
|
||||||
|
StartGame(filename);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void DMainWindow::on_actStop_triggered()
|
||||||
|
{
|
||||||
|
if (Core::GetState() != Core::CORE_UNINITIALIZED && !m_isStopping)
|
||||||
|
{
|
||||||
|
m_isStopping = true;
|
||||||
|
// Ask for confirmation in case the user accidentally clicked Stop / Escape
|
||||||
|
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bConfirmStop)
|
||||||
|
{
|
||||||
|
int ret = QMessageBox::question(m_render_widget.get(), tr("Please confirm..."),
|
||||||
|
tr("Do you want to stop the current emulation?"),
|
||||||
|
QMessageBox::Yes | QMessageBox::No, QMessageBox::No);
|
||||||
|
|
||||||
|
if (ret == QMessageBox::No)
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO: Movie stuff
|
||||||
|
// TODO: Show the author/description dialog here
|
||||||
|
|
||||||
|
// TODO: Show busy cursor
|
||||||
|
BootManager::Stop();
|
||||||
|
// TODO: Hide busy cursor again
|
||||||
|
|
||||||
|
// TODO: Allow screensaver again
|
||||||
|
// TODO: Restore original window title
|
||||||
|
|
||||||
|
// TODO: Return from fullscreen if necessary (DoFullscreen in the wx code)
|
||||||
|
|
||||||
|
// TODO:
|
||||||
|
// If batch mode was specified on the command-line, exit now.
|
||||||
|
//if (m_bBatchMode)
|
||||||
|
// Close(true);
|
||||||
|
|
||||||
|
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain)
|
||||||
|
m_ui->centralWidget->removeWidget(m_render_widget.get());
|
||||||
|
else
|
||||||
|
m_render_widget->close();
|
||||||
|
m_render_widget.reset();
|
||||||
|
|
||||||
|
emit CoreStateChanged(Core::CORE_UNINITIALIZED);
|
||||||
|
}
|
||||||
|
m_isStopping = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void DMainWindow::OnCoreStateChanged(Core::EState state)
|
||||||
|
{
|
||||||
|
bool is_not_initialized = (state == Core::CORE_UNINITIALIZED);
|
||||||
|
bool is_running = (state == Core::CORE_RUN);
|
||||||
|
bool is_paused = (state == Core::CORE_PAUSE);
|
||||||
|
|
||||||
|
// Update the toolbar
|
||||||
|
m_ui->actPlay->setEnabled(is_not_initialized || is_running || is_paused);
|
||||||
|
if (is_running)
|
||||||
|
{
|
||||||
|
m_ui->actPlay->setIcon(Resources::GetIcon(Resources::TOOLBAR_PAUSE));
|
||||||
|
m_ui->actPlay->setText(tr("Pause"));
|
||||||
|
}
|
||||||
|
else if (is_paused || is_not_initialized)
|
||||||
|
{
|
||||||
|
m_ui->actPlay->setIcon(Resources::GetIcon(Resources::TOOLBAR_PLAY));
|
||||||
|
m_ui->actPlay->setText(tr("Play"));
|
||||||
|
}
|
||||||
|
|
||||||
|
m_ui->actStop->setEnabled(!is_not_initialized);
|
||||||
|
m_ui->actOpen->setEnabled(is_not_initialized);
|
||||||
|
}
|
||||||
|
|
||||||
|
// DRenderWidget
|
||||||
|
void DMainWindow::RenderWidgetSize(int& x_pos, int& y_pos, int& w, int& h)
|
||||||
|
{
|
||||||
|
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain)
|
||||||
|
{
|
||||||
|
x_pos = x();
|
||||||
|
y_pos = y();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
x_pos = m_render_widget->x();
|
||||||
|
y_pos = m_render_widget->y();
|
||||||
|
}
|
||||||
|
w = m_render_widget->width();
|
||||||
|
h = m_render_widget->height();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool DMainWindow::RenderWidgetHasFocus()
|
||||||
|
{
|
||||||
|
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain)
|
||||||
|
return isActiveWindow();
|
||||||
|
else if (m_render_widget != nullptr)
|
||||||
|
return m_render_widget->isActiveWindow();
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update all the icons used in DMainWindow with fresh ones from
|
||||||
|
// "Resources". Call this function after changing the icon theme.
|
||||||
|
void DMainWindow::UpdateIcons()
|
||||||
|
{
|
||||||
|
m_ui->actOpen->setIcon(Resources::GetIcon(Resources::TOOLBAR_OPEN));
|
||||||
|
m_ui->actStop->setIcon(Resources::GetIcon(Resources::TOOLBAR_STOP));
|
||||||
|
}
|
||||||
|
|
||||||
|
// Help menu
|
||||||
void DMainWindow::on_actWebsite_triggered()
|
void DMainWindow::on_actWebsite_triggered()
|
||||||
{
|
{
|
||||||
QDesktopServices::openUrl(QUrl(SL("https://dolphin-emu.org/")));
|
QDesktopServices::openUrl(QUrl(SL("https://dolphin-emu.org/")));
|
||||||
|
|
|
@ -7,6 +7,10 @@
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <QMainWindow>
|
#include <QMainWindow>
|
||||||
|
|
||||||
|
#include "Core/Core.h"
|
||||||
|
|
||||||
|
#include "DolphinQt/VideoInterface/RenderWidget.h"
|
||||||
|
|
||||||
// Predefinitions
|
// Predefinitions
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
|
@ -21,7 +25,23 @@ public:
|
||||||
explicit DMainWindow(QWidget* parent_widget = nullptr);
|
explicit DMainWindow(QWidget* parent_widget = nullptr);
|
||||||
~DMainWindow();
|
~DMainWindow();
|
||||||
|
|
||||||
|
// DRenderWidget
|
||||||
|
void RenderWidgetSize(int& x_pos, int& y_pos, int& w, int& h);
|
||||||
|
bool RenderWidgetHasFocus();
|
||||||
|
DRenderWidget* GetRenderWidget() { return m_render_widget.get(); }
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void CoreStateChanged(Core::EState state);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
|
// Emulation
|
||||||
|
void StartGame(const QString filename);
|
||||||
|
void OnCoreStateChanged(Core::EState state);
|
||||||
|
|
||||||
|
// Main toolbar
|
||||||
|
void on_actOpen_triggered();
|
||||||
|
void on_actPlay_triggered();
|
||||||
|
void on_actStop_triggered();
|
||||||
|
|
||||||
// Help menu
|
// Help menu
|
||||||
void on_actWebsite_triggered();
|
void on_actWebsite_triggered();
|
||||||
|
@ -30,6 +50,20 @@ private slots:
|
||||||
void on_actSystemInfo_triggered();
|
void on_actSystemInfo_triggered();
|
||||||
void on_actAbout_triggered();
|
void on_actAbout_triggered();
|
||||||
|
|
||||||
|
// Misc.
|
||||||
|
void UpdateIcons();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::unique_ptr<Ui::DMainWindow> m_ui;
|
std::unique_ptr<Ui::DMainWindow> m_ui;
|
||||||
|
|
||||||
|
// Emulation
|
||||||
|
QString RequestBootFilename();
|
||||||
|
QString ShowFileDialog();
|
||||||
|
void DoStartPause();
|
||||||
|
|
||||||
|
std::unique_ptr<DRenderWidget> m_render_widget;
|
||||||
|
bool m_isStopping = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Pointer to the only instance of DMainWindow, used by Host_*
|
||||||
|
extern DMainWindow* g_main_window;
|
||||||
|
|
|
@ -25,14 +25,14 @@
|
||||||
<property name="unifiedTitleAndToolBarOnMac">
|
<property name="unifiedTitleAndToolBarOnMac">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QStackedWidget" name="wgtCentral"/>
|
<widget class="QStackedWidget" name="centralWidget"/>
|
||||||
<widget class="QMenuBar" name="menubar">
|
<widget class="QMenuBar" name="menubar">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>992</width>
|
<width>992</width>
|
||||||
<height>24</height>
|
<height>21</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QMenu" name="mnuFile">
|
<widget class="QMenu" name="mnuFile">
|
||||||
|
@ -97,6 +97,9 @@
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
</attribute>
|
</attribute>
|
||||||
<addaction name="actOpen"/>
|
<addaction name="actOpen"/>
|
||||||
|
<addaction name="separator"/>
|
||||||
|
<addaction name="actPlay"/>
|
||||||
|
<addaction name="actStop"/>
|
||||||
</widget>
|
</widget>
|
||||||
<action name="actWebsite">
|
<action name="actWebsite">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
|
@ -134,6 +137,16 @@
|
||||||
<string>&System Information</string>
|
<string>&System Information</string>
|
||||||
</property>
|
</property>
|
||||||
</action>
|
</action>
|
||||||
|
<action name="actPlay">
|
||||||
|
<property name="text">
|
||||||
|
<string>Play</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="actStop">
|
||||||
|
<property name="text">
|
||||||
|
<string>Stop</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
<connections/>
|
<connections/>
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
// Copyright 2014 Dolphin Emulator Project
|
||||||
|
// Licensed under GPLv2
|
||||||
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#include <QMessageBox>
|
||||||
|
|
||||||
|
#include "DolphinQt/VideoInterface/RenderWidget.h"
|
||||||
|
|
||||||
|
DRenderWidget::DRenderWidget(QWidget* parent_widget)
|
||||||
|
: QWidget(parent_widget)
|
||||||
|
{
|
||||||
|
setAttribute(Qt::WA_NativeWindow, true);
|
||||||
|
setAttribute(Qt::WA_OpaquePaintEvent, true);
|
||||||
|
setAttribute(Qt::WA_NoSystemBackground, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
void DRenderWidget::closeEvent(QCloseEvent* e)
|
||||||
|
{
|
||||||
|
// TODO: update render window positions in config
|
||||||
|
|
||||||
|
// TODO: Do this differently...
|
||||||
|
emit Closed();
|
||||||
|
QWidget::closeEvent(e);
|
||||||
|
}
|
|
@ -0,0 +1,28 @@
|
||||||
|
// Copyright 2014 Dolphin Emulator Project
|
||||||
|
// Licensed under GPLv2
|
||||||
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
|
class DRenderWidget : public QWidget
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
DRenderWidget(QWidget* parent_widget = nullptr);
|
||||||
|
|
||||||
|
protected:
|
||||||
|
// Some window managers start window dragging if an "empty" window area was clicked.
|
||||||
|
// Prevent this by intercepting the mouse press event.
|
||||||
|
void mousePressEvent(QMouseEvent*) override {}
|
||||||
|
void paintEvent(QPaintEvent*) override {}
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void closeEvent(QCloseEvent* e) override;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void Closed();
|
||||||
|
};
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
// Copyright 2014 Dolphin Emulator Project
|
|
||||||
// Licensed under GPLv2
|
|
||||||
// Refer to the license.txt file included.
|
|
||||||
|
|
||||||
#include "VideoBackends/OGL/GLInterfaceBase.h"
|
|
||||||
|
|
||||||
cInterfaceBase* HostGL_CreateGLInterface()
|
|
||||||
{
|
|
||||||
// TODO
|
|
||||||
return nullptr;
|
|
||||||
}
|
|
|
@ -8,10 +8,6 @@ set(LIBS core
|
||||||
${GTK2_LIBRARIES})
|
${GTK2_LIBRARIES})
|
||||||
|
|
||||||
if(NOT ANDROID)
|
if(NOT ANDROID)
|
||||||
if(USE_X11)
|
|
||||||
set(LIBS ${LIBS} ${XRANDR_LIBRARIES})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
link_directories(${CMAKE_PREFIX_PATH}/lib)
|
link_directories(${CMAKE_PREFIX_PATH}/lib)
|
||||||
else()
|
else()
|
||||||
set(LIBS ${LIBS} png iconv)
|
set(LIBS ${LIBS} png iconv)
|
||||||
|
@ -76,31 +72,6 @@ set(WXLIBS ${wxWidgets_LIBRARIES} dl)
|
||||||
set(ANDROID_SRCS Android/ButtonManager.cpp
|
set(ANDROID_SRCS Android/ButtonManager.cpp
|
||||||
MainAndroid.cpp)
|
MainAndroid.cpp)
|
||||||
|
|
||||||
if(USE_EGL)
|
|
||||||
set(SRCS ${SRCS} GLInterface/EGL.cpp)
|
|
||||||
if(ANDROID)
|
|
||||||
set(SRCS ${SRCS} GLInterface/EGLAndroid.cpp)
|
|
||||||
elseif(USE_X11)
|
|
||||||
set(SRCS ${SRCS} GLInterface/EGLX11.cpp)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(WIN32)
|
|
||||||
set(SRCS ${SRCS} GLInterface/WGL.cpp)
|
|
||||||
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
|
||||||
set(SRCS ${SRCS} GLInterface/AGL.cpp)
|
|
||||||
elseif(USE_X11)
|
|
||||||
if (NOT USE_EGL)
|
|
||||||
set(SRCS ${SRCS} GLInterface/GLX.cpp)
|
|
||||||
# GLX has a hard dependency on libGL.
|
|
||||||
# Make sure to link to it if using GLX.
|
|
||||||
set(LIBS ${LIBS} ${OPENGL_LIBRARIES})
|
|
||||||
endif()
|
|
||||||
set(SRCS ${SRCS} GLInterface/X11_Util.cpp)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
set(SRCS ${SRCS} GLInterface/GLInterface.cpp)
|
|
||||||
|
|
||||||
set(NOGUI_SRCS MainNoGUI.cpp)
|
set(NOGUI_SRCS MainNoGUI.cpp)
|
||||||
|
|
||||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
|
@ -125,8 +96,6 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
list(APPEND SRCS ${RESOURCES})
|
list(APPEND SRCS ${RESOURCES})
|
||||||
set_source_files_properties(${RESOURCES} PROPERTIES
|
set_source_files_properties(${RESOURCES} PROPERTIES
|
||||||
MACOSX_PACKAGE_LOCATION Resources)
|
MACOSX_PACKAGE_LOCATION Resources)
|
||||||
elseif(USE_X11)
|
|
||||||
set(SRCS ${SRCS} X11Utils.cpp)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR
|
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
#include "Common/CommonTypes.h"
|
#include "Common/CommonTypes.h"
|
||||||
#if defined(HAVE_XRANDR) && HAVE_XRANDR
|
#if defined(HAVE_XRANDR) && HAVE_XRANDR
|
||||||
#include "DolphinWX/X11Utils.h"
|
#include "VideoBackends/OGL/GLInterface/X11Utils.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
class wxBoxSizer;
|
class wxBoxSizer;
|
||||||
|
|
|
@ -78,8 +78,6 @@
|
||||||
<ClCompile Include="FrameAui.cpp" />
|
<ClCompile Include="FrameAui.cpp" />
|
||||||
<ClCompile Include="FrameTools.cpp" />
|
<ClCompile Include="FrameTools.cpp" />
|
||||||
<ClCompile Include="GameListCtrl.cpp" />
|
<ClCompile Include="GameListCtrl.cpp" />
|
||||||
<ClCompile Include="GLInterface\GLInterface.cpp" />
|
|
||||||
<ClCompile Include="GLInterface\WGL.cpp" />
|
|
||||||
<ClCompile Include="HotkeyDlg.cpp" />
|
<ClCompile Include="HotkeyDlg.cpp" />
|
||||||
<ClCompile Include="InputConfigDiag.cpp" />
|
<ClCompile Include="InputConfigDiag.cpp" />
|
||||||
<ClCompile Include="InputConfigDiagBitmaps.cpp" />
|
<ClCompile Include="InputConfigDiagBitmaps.cpp" />
|
||||||
|
@ -131,7 +129,6 @@
|
||||||
<ClInclude Include="FifoPlayerDlg.h" />
|
<ClInclude Include="FifoPlayerDlg.h" />
|
||||||
<ClInclude Include="Frame.h" />
|
<ClInclude Include="Frame.h" />
|
||||||
<ClInclude Include="GameListCtrl.h" />
|
<ClInclude Include="GameListCtrl.h" />
|
||||||
<ClInclude Include="GLInterface\WGL.h" />
|
|
||||||
<ClInclude Include="Globals.h" />
|
<ClInclude Include="Globals.h" />
|
||||||
<ClInclude Include="HotkeyDlg.h" />
|
<ClInclude Include="HotkeyDlg.h" />
|
||||||
<ClInclude Include="InputConfigDiag.h" />
|
<ClInclude Include="InputConfigDiag.h" />
|
||||||
|
|
|
@ -27,8 +27,6 @@
|
||||||
</Filter>
|
</Filter>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="GLInterface\GLInterface.cpp" />
|
|
||||||
<ClCompile Include="GLInterface\WGL.cpp" />
|
|
||||||
<ClCompile Include="Main.cpp" />
|
<ClCompile Include="Main.cpp" />
|
||||||
<ClCompile Include="MainNoGUI.cpp" />
|
<ClCompile Include="MainNoGUI.cpp" />
|
||||||
<ClCompile Include="WXInputBase.cpp" />
|
<ClCompile Include="WXInputBase.cpp" />
|
||||||
|
@ -170,7 +168,6 @@
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="GLInterface\WGL.h" />
|
|
||||||
<ClInclude Include="Main.h" />
|
<ClInclude Include="Main.h" />
|
||||||
<ClInclude Include="WXInputBase.h" />
|
<ClInclude Include="WXInputBase.h" />
|
||||||
<ClInclude Include="WxUtils.h" />
|
<ClInclude Include="WxUtils.h" />
|
||||||
|
|
|
@ -72,6 +72,23 @@ extern "C" {
|
||||||
|
|
||||||
int g_saveSlot = 1;
|
int g_saveSlot = 1;
|
||||||
|
|
||||||
|
#if defined(HAVE_X11) && HAVE_X11
|
||||||
|
// X11Utils nastiness that's only used here
|
||||||
|
namespace X11Utils {
|
||||||
|
|
||||||
|
Window XWindowFromHandle(void *Handle)
|
||||||
|
{
|
||||||
|
return GDK_WINDOW_XID(gtk_widget_get_window(GTK_WIDGET(Handle)));
|
||||||
|
}
|
||||||
|
|
||||||
|
Display *XDisplayFromHandle(void *Handle)
|
||||||
|
{
|
||||||
|
return GDK_WINDOW_XDISPLAY(gtk_widget_get_window(GTK_WIDGET(Handle)));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
CRenderFrame::CRenderFrame(wxFrame* parent, wxWindowID id, const wxString& title,
|
CRenderFrame::CRenderFrame(wxFrame* parent, wxWindowID id, const wxString& title,
|
||||||
const wxPoint& pos, const wxSize& size, long style)
|
const wxPoint& pos, const wxSize& size, long style)
|
||||||
: wxFrame(parent, id, title, pos, size, style)
|
: wxFrame(parent, id, title, pos, size, style)
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
#include "InputCommon/GCPadStatus.h"
|
#include "InputCommon/GCPadStatus.h"
|
||||||
|
|
||||||
#if defined(HAVE_X11) && HAVE_X11
|
#if defined(HAVE_X11) && HAVE_X11
|
||||||
#include "DolphinWX/X11Utils.h"
|
#include "VideoBackends/OGL/GLInterface/X11Utils.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Class declarations
|
// Class declarations
|
||||||
|
|
|
@ -129,7 +129,7 @@ void Host_ShowVideoConfig(void*, const std::string&, const std::string&) {}
|
||||||
|
|
||||||
#if HAVE_X11
|
#if HAVE_X11
|
||||||
#include <X11/keysym.h>
|
#include <X11/keysym.h>
|
||||||
#include "DolphinWX/X11Utils.h"
|
#include "VideoBackends/OGL/GLInterface/X11Utils.h"
|
||||||
|
|
||||||
class PlatformX11 : public Platform
|
class PlatformX11 : public Platform
|
||||||
{
|
{
|
||||||
|
|
|
@ -14,14 +14,40 @@ set(SRCS GLExtensions/GLExtensions.cpp
|
||||||
TextureConverter.cpp
|
TextureConverter.cpp
|
||||||
VertexManager.cpp)
|
VertexManager.cpp)
|
||||||
|
|
||||||
set(LIBS videocommon
|
if(USE_EGL)
|
||||||
|
set(SRCS ${SRCS} GLInterface/EGL.cpp)
|
||||||
|
if(ANDROID)
|
||||||
|
set(SRCS ${SRCS} GLInterface/EGLAndroid.cpp)
|
||||||
|
elseif(USE_X11)
|
||||||
|
set(SRCS ${SRCS} GLInterface/EGLX11.cpp)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
set(SRCS ${SRCS} GLInterface/WGL.cpp)
|
||||||
|
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||||
|
set(SRCS ${SRCS} GLInterface/AGL.cpp)
|
||||||
|
elseif(USE_X11)
|
||||||
|
if (NOT USE_EGL)
|
||||||
|
set(SRCS ${SRCS} GLInterface/GLX.cpp)
|
||||||
|
# GLX has a hard dependency on libGL.
|
||||||
|
# Make sure to link to it if using GLX.
|
||||||
|
set(LIBS ${LIBS} ${OPENGL_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
set(SRCS ${SRCS} GLInterface/X11_Util.cpp GLInterface/X11Utils.cpp)
|
||||||
|
set(LIBS ${LIBS} ${XRANDR_LIBRARIES})
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set(SRCS ${SRCS} GLInterface/GLInterface.cpp)
|
||||||
|
|
||||||
|
set(LIBS ${LIBS}
|
||||||
|
videocommon
|
||||||
SOIL
|
SOIL
|
||||||
common
|
common
|
||||||
dl
|
dl
|
||||||
${X11_LIBRARIES})
|
${X11_LIBRARIES})
|
||||||
if(USE_EGL)
|
if(USE_EGL)
|
||||||
set(LIBS ${LIBS}
|
set(LIBS ${LIBS} EGL)
|
||||||
EGL)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR
|
if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD" OR
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// Licensed under GPLv2
|
// Licensed under GPLv2
|
||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
#include "DolphinWX/GLInterface/AGL.h"
|
#include "VideoBackends/OGL/GLInterface/AGL.h"
|
||||||
|
|
||||||
#include "VideoCommon/RenderBase.h"
|
#include "VideoCommon/RenderBase.h"
|
||||||
#include "VideoCommon/VertexShaderManager.h"
|
#include "VideoCommon/VertexShaderManager.h"
|
|
@ -2,8 +2,8 @@
|
||||||
// Licensed under GPLv2
|
// Licensed under GPLv2
|
||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
#include "DolphinWX/GLInterface/EGL.h"
|
|
||||||
#include "VideoBackends/OGL/GLInterfaceBase.h"
|
#include "VideoBackends/OGL/GLInterfaceBase.h"
|
||||||
|
#include "VideoBackends/OGL/GLInterface/EGL.h"
|
||||||
#include "VideoCommon/RenderBase.h"
|
#include "VideoCommon/RenderBase.h"
|
||||||
|
|
||||||
// Show the current FPS
|
// Show the current FPS
|
|
@ -3,7 +3,7 @@
|
||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
#include "Core/Host.h"
|
#include "Core/Host.h"
|
||||||
#include "DolphinWX/GLInterface/EGLAndroid.h"
|
#include "VideoBackends/OGL/GLInterface/EGLAndroid.h"
|
||||||
|
|
||||||
EGLDisplay cInterfaceEGLAndroid::OpenDisplay()
|
EGLDisplay cInterfaceEGLAndroid::OpenDisplay()
|
||||||
{
|
{
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "DolphinWX/GLInterface/EGL.h"
|
#include "VideoBackends/OGL/GLInterface/EGL.h"
|
||||||
|
|
||||||
class cInterfaceEGLAndroid : public cInterfaceEGL
|
class cInterfaceEGLAndroid : public cInterfaceEGL
|
||||||
{
|
{
|
|
@ -2,7 +2,7 @@
|
||||||
// Licensed under GPLv2
|
// Licensed under GPLv2
|
||||||
// Refer to the license.txt file included.
|
// Refer to the license.txt file included.
|
||||||
|
|
||||||
#include "DolphinWX/GLInterface/EGLX11.h"
|
#include "VideoBackends/OGL/GLInterface/EGLX11.h"
|
||||||
|
|
||||||
EGLDisplay cInterfaceEGLX11::OpenDisplay()
|
EGLDisplay cInterfaceEGLX11::OpenDisplay()
|
||||||
{
|
{
|
|
@ -6,8 +6,8 @@
|
||||||
|
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
|
|
||||||
#include "DolphinWX/GLInterface/EGL.h"
|
#include "VideoBackends/OGL/GLInterface/EGL.h"
|
||||||
#include "DolphinWX/GLInterface/X11_Util.h"
|
#include "VideoBackends/OGL/GLInterface/X11_Util.h"
|
||||||
|
|
||||||
class cInterfaceEGLX11 : public cInterfaceEGL
|
class cInterfaceEGLX11 : public cInterfaceEGL
|
||||||
{
|
{
|
|
@ -5,16 +5,16 @@
|
||||||
#include "VideoBackends/OGL/GLInterfaceBase.h"
|
#include "VideoBackends/OGL/GLInterfaceBase.h"
|
||||||
|
|
||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
#include "DolphinWX/GLInterface/EGLAndroid.h"
|
#include "VideoBackends/OGL/GLInterface/EGLAndroid.h"
|
||||||
#elif defined(__APPLE__)
|
#elif defined(__APPLE__)
|
||||||
#include "DolphinWX/GLInterface/AGL.h"
|
#include "VideoBackends/OGL/GLInterface/AGL.h"
|
||||||
#elif defined(_WIN32)
|
#elif defined(_WIN32)
|
||||||
#include "DolphinWX/GLInterface/WGL.h"
|
#include "VideoBackends/OGL/GLInterface/WGL.h"
|
||||||
#elif HAVE_X11
|
#elif HAVE_X11
|
||||||
#if defined(USE_EGL) && USE_EGL
|
#if defined(USE_EGL) && USE_EGL
|
||||||
#include "DolphinWX/GLInterface/EGLX11.h"
|
#include "VideoBackends/OGL/GLInterface/EGLX11.h"
|
||||||
#else
|
#else
|
||||||
#include "DolphinWX/GLInterface/GLX.h"
|
#include "VideoBackends/OGL/GLInterface/GLX.h"
|
||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
#error Platform doesnt have a GLInterface
|
#error Platform doesnt have a GLInterface
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "DolphinWX/GLInterface/GLX.h"
|
#include "VideoBackends/OGL/GLInterface/GLX.h"
|
||||||
|
|
||||||
#include "VideoCommon/RenderBase.h"
|
#include "VideoCommon/RenderBase.h"
|
||||||
#include "VideoCommon/VideoConfig.h"
|
#include "VideoCommon/VideoConfig.h"
|
|
@ -7,8 +7,8 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <GL/glx.h>
|
#include <GL/glx.h>
|
||||||
|
|
||||||
#include "DolphinWX/GLInterface/X11_Util.h"
|
|
||||||
#include "VideoBackends/OGL/GLInterfaceBase.h"
|
#include "VideoBackends/OGL/GLInterfaceBase.h"
|
||||||
|
#include "VideoBackends/OGL/GLInterface/X11_Util.h"
|
||||||
|
|
||||||
class cInterfaceGLX : public cInterfaceBase
|
class cInterfaceGLX : public cInterfaceBase
|
||||||
{
|
{
|
|
@ -6,7 +6,7 @@
|
||||||
|
|
||||||
#include "Core/Host.h"
|
#include "Core/Host.h"
|
||||||
|
|
||||||
#include "DolphinWX/GLInterface/WGL.h"
|
#include "VideoBackends/OGL/GLInterface/WGL.h"
|
||||||
|
|
||||||
#include "VideoCommon/RenderBase.h"
|
#include "VideoCommon/RenderBase.h"
|
||||||
#include "VideoCommon/VertexShaderManager.h"
|
#include "VideoCommon/VertexShaderManager.h"
|
|
@ -10,7 +10,7 @@
|
||||||
#include "Core/ConfigManager.h"
|
#include "Core/ConfigManager.h"
|
||||||
#include "Core/Core.h"
|
#include "Core/Core.h"
|
||||||
#include "Core/CoreParameter.h"
|
#include "Core/CoreParameter.h"
|
||||||
#include "DolphinWX/X11Utils.h"
|
#include "VideoBackends/OGL/GLInterface/X11Utils.h"
|
||||||
|
|
||||||
extern char **environ;
|
extern char **environ;
|
||||||
|
|
||||||
|
@ -41,19 +41,6 @@ void ToggleFullscreen(Display *dpy, Window win)
|
||||||
ERROR_LOG(VIDEO, "Failed to switch fullscreen/windowed mode.");
|
ERROR_LOG(VIDEO, "Failed to switch fullscreen/windowed mode.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#if defined(HAVE_WX) && HAVE_WX
|
|
||||||
Window XWindowFromHandle(void *Handle)
|
|
||||||
{
|
|
||||||
return GDK_WINDOW_XID(gtk_widget_get_window(GTK_WIDGET(Handle)));
|
|
||||||
}
|
|
||||||
|
|
||||||
Display *XDisplayFromHandle(void *Handle)
|
|
||||||
{
|
|
||||||
return GDK_WINDOW_XDISPLAY(gtk_widget_get_window(GTK_WIDGET(Handle)));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void InhibitScreensaver(Display *dpy, Window win, bool suspend)
|
void InhibitScreensaver(Display *dpy, Window win, bool suspend)
|
||||||
{
|
{
|
||||||
char id[11];
|
char id[11];
|
|
@ -4,8 +4,8 @@
|
||||||
|
|
||||||
#include "Common/Thread.h"
|
#include "Common/Thread.h"
|
||||||
#include "Core/Host.h"
|
#include "Core/Host.h"
|
||||||
#include "DolphinWX/GLInterface/X11_Util.h"
|
|
||||||
#include "VideoBackends/OGL/GLInterfaceBase.h"
|
#include "VideoBackends/OGL/GLInterfaceBase.h"
|
||||||
|
#include "VideoBackends/OGL/GLInterface/X11_Util.h"
|
||||||
#include "VideoCommon/VideoConfig.h"
|
#include "VideoCommon/VideoConfig.h"
|
||||||
|
|
||||||
void cX11Window::Initialize(Display *_dpy)
|
void cX11Window::Initialize(Display *_dpy)
|
|
@ -37,6 +37,8 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="FramebufferManager.cpp" />
|
<ClCompile Include="FramebufferManager.cpp" />
|
||||||
<ClCompile Include="GLExtensions\GLExtensions.cpp" />
|
<ClCompile Include="GLExtensions\GLExtensions.cpp" />
|
||||||
|
<ClCompile Include="GLInterface\GLInterface.cpp" />
|
||||||
|
<ClCompile Include="GLInterface\WGL.cpp" />
|
||||||
<ClCompile Include="GLUtil.cpp" />
|
<ClCompile Include="GLUtil.cpp" />
|
||||||
<ClCompile Include="main.cpp" />
|
<ClCompile Include="main.cpp" />
|
||||||
<ClCompile Include="NativeVertexFormat.cpp" />
|
<ClCompile Include="NativeVertexFormat.cpp" />
|
||||||
|
@ -80,6 +82,7 @@
|
||||||
<ClInclude Include="GLExtensions\gl_common.h" />
|
<ClInclude Include="GLExtensions\gl_common.h" />
|
||||||
<ClInclude Include="GLExtensions\KHR_debug.h" />
|
<ClInclude Include="GLExtensions\KHR_debug.h" />
|
||||||
<ClInclude Include="GLExtensions\NV_primitive_restart.h" />
|
<ClInclude Include="GLExtensions\NV_primitive_restart.h" />
|
||||||
|
<ClInclude Include="GLInterface\WGL.h" />
|
||||||
<ClInclude Include="GLUtil.h" />
|
<ClInclude Include="GLUtil.h" />
|
||||||
<ClInclude Include="main.h" />
|
<ClInclude Include="main.h" />
|
||||||
<ClInclude Include="PerfQuery.h" />
|
<ClInclude Include="PerfQuery.h" />
|
||||||
|
|
|
@ -16,6 +16,9 @@
|
||||||
<Filter Include="GLExtensions">
|
<Filter Include="GLExtensions">
|
||||||
<UniqueIdentifier>{4366f285-ded5-48c9-9464-03fb46174526}</UniqueIdentifier>
|
<UniqueIdentifier>{4366f285-ded5-48c9-9464-03fb46174526}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<Filter Include="GLInterface">
|
||||||
|
<UniqueIdentifier>{1734a626-f6e2-41b1-8753-43447bed39af}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="NativeVertexFormat.cpp">
|
<ClCompile Include="NativeVertexFormat.cpp">
|
||||||
|
@ -59,6 +62,12 @@
|
||||||
<ClCompile Include="GLExtensions\GLExtensions.cpp">
|
<ClCompile Include="GLExtensions\GLExtensions.cpp">
|
||||||
<Filter>GLExtensions</Filter>
|
<Filter>GLExtensions</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="GLInterface\GLInterface.cpp">
|
||||||
|
<Filter>GLInterface</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="GLInterface\WGL.cpp">
|
||||||
|
<Filter>GLInterface</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="VertexManager.h">
|
<ClInclude Include="VertexManager.h">
|
||||||
|
@ -178,6 +187,9 @@
|
||||||
<ClInclude Include="GLExtensions\KHR_debug.h">
|
<ClInclude Include="GLExtensions\KHR_debug.h">
|
||||||
<Filter>GLExtensions</Filter>
|
<Filter>GLExtensions</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="GLInterface\WGL.h">
|
||||||
|
<Filter>GLInterface</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Text Include="CMakeLists.txt" />
|
<Text Include="CMakeLists.txt" />
|
||||||
|
|
Loading…
Reference in New Issue