From ceb924f398a86f992391d59dbb1b0e668aac9e18 Mon Sep 17 00:00:00 2001 From: "fires.gc" Date: Thu, 17 Jul 2008 10:17:19 +0000 Subject: [PATCH] added option "render to main window" to opengl video plugin git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@16 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Plugins/Plugin_VideoDX9/Src/DlgSettings.cpp | 4 ++-- Source/Plugins/Plugin_VideoDX9/Src/Globals.cpp | 4 ++-- Source/Plugins/Plugin_VideoDX9/Src/Globals.h | 2 +- Source/Plugins/Plugin_VideoDX9/Src/main.cpp | 2 +- Source/Plugins/Plugin_VideoDX9/Src/resource.h | 3 +-- Source/Plugins/Plugin_VideoDX9/Src/resource.rc | 2 +- Source/Plugins/Plugin_VideoOGL/Src/GLInit.cpp | 3 +-- Source/Plugins/Plugin_VideoOGL/Src/Globals.cpp | 2 ++ Source/Plugins/Plugin_VideoOGL/Src/Globals.h | 1 + .../Plugin_VideoOGL/Src/Windows/DlgSettings.cpp | 3 +++ .../Plugins/Plugin_VideoOGL/Src/Windows/resource.h | 1 + .../Plugins/Plugin_VideoOGL/Src/Windows/resource.rc | 13 +++++++------ 12 files changed, 23 insertions(+), 17 deletions(-) diff --git a/Source/Plugins/Plugin_VideoDX9/Src/DlgSettings.cpp b/Source/Plugins/Plugin_VideoDX9/Src/DlgSettings.cpp index f9217cfc92..88afaca708 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/DlgSettings.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/DlgSettings.cpp @@ -62,7 +62,7 @@ struct TabDirect3D : public W32Util::Tab CheckDlgButton(hDlg, IDC_FULLSCREENENABLE, g_Config.bFullscreen ? TRUE : FALSE); CheckDlgButton(hDlg, IDC_VSYNC, g_Config.bVsync ? TRUE : FALSE); - CheckDlgButton(hDlg, IDC_RENDER_IN_MAINWINDOW, g_Config.renderInMainframe ? TRUE : FALSE); + CheckDlgButton(hDlg, IDC_RENDER_TO_MAINWINDOW, g_Config.renderToMainframe ? TRUE : FALSE); } void Command(HWND hDlg,WPARAM wParam) @@ -84,7 +84,7 @@ struct TabDirect3D : public W32Util::Tab g_Config.iFSResolution = ComboBox_GetCurSel(GetDlgItem(hDlg,IDC_RESOLUTION)); g_Config.bFullscreen = Button_GetCheck(GetDlgItem(hDlg, IDC_FULLSCREENENABLE)) ? true : false; g_Config.bVsync = Button_GetCheck(GetDlgItem(hDlg, IDC_VSYNC)) ? true : false; - g_Config.renderInMainframe = Button_GetCheck(GetDlgItem(hDlg, IDC_RENDER_IN_MAINWINDOW)) ? true : false; + g_Config.renderToMainframe = Button_GetCheck(GetDlgItem(hDlg, IDC_RENDER_TO_MAINWINDOW)) ? true : false; g_Config.Save(); } }; diff --git a/Source/Plugins/Plugin_VideoDX9/Src/Globals.cpp b/Source/Plugins/Plugin_VideoDX9/Src/Globals.cpp index db3ba9ffe5..8ff072fe81 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/Globals.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/Globals.cpp @@ -15,7 +15,7 @@ void Config::Load() iniFile.Get("Hardware", "WindowedRes", &iWindowedRes, 0); iniFile.Get("Hardware", "FullscreenRes", &iFSResolution, 0); iniFile.Get("Hardware", "Fullscreen", &bFullscreen, 0); - iniFile.Get("Hardware", "RenderInMainframe", &renderInMainframe, true); + iniFile.Get("Hardware", "RenderInMainframe", &renderToMainframe, true); iniFile.Get("Hardware", "VSync", &bVsync, 0); if (iAdapter == -1) iAdapter = 0; @@ -41,7 +41,7 @@ void Config::Save() iniFile.Set("Hardware", "FullscreenRes", iFSResolution); iniFile.Set("Hardware", "Fullscreen", bFullscreen); iniFile.Set("Hardware", "VSync", bVsync); - iniFile.Set("Hardware", "RenderInMainframe", renderInMainframe); + iniFile.Set("Hardware", "RenderInMainframe", renderToMainframe); iniFile.Set("Settings", "OverlayStats", bOverlayStats); iniFile.Set("Settings", "OverlayStats", bOverlayStats); diff --git a/Source/Plugins/Plugin_VideoDX9/Src/Globals.h b/Source/Plugins/Plugin_VideoDX9/Src/Globals.h index 9800d90352..0167ea67c3 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/Globals.h +++ b/Source/Plugins/Plugin_VideoDX9/Src/Globals.h @@ -16,7 +16,7 @@ struct Config int iPostprocessEffect; int iCompileDLsLevel; - bool renderInMainframe; + bool renderToMainframe; bool bFullscreen; bool bVsync; bool bWireFrame; diff --git a/Source/Plugins/Plugin_VideoDX9/Src/main.cpp b/Source/Plugins/Plugin_VideoDX9/Src/main.cpp index d03fde5d80..8d8b45655a 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/main.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/main.cpp @@ -71,7 +71,7 @@ bool Init() if (initCount==0) { // create the window - if( !g_Config.renderInMainframe || g_VideoInitialize.pWindowHandle == NULL ) // ignore parent for this plugin + if( !g_Config.renderToMainframe || g_VideoInitialize.pWindowHandle == NULL ) // ignore parent for this plugin { g_VideoInitialize.pWindowHandle = (void*)EmuWindow::Create(NULL, g_hInstance, "Please wait..."); } diff --git a/Source/Plugins/Plugin_VideoDX9/Src/resource.h b/Source/Plugins/Plugin_VideoDX9/Src/resource.h index 4aac2298ff..231b90ec79 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/resource.h +++ b/Source/Plugins/Plugin_VideoDX9/Src/resource.h @@ -17,8 +17,7 @@ #define IDC_FULLSCREENENABLE2 1003 #define IDC_VSYNC 1003 #define IDC_DEBUGSTEP 1004 -#define IDC_VSYNC2 1004 -#define IDC_RENDER_IN_MAINWINDOW 1004 +#define IDC_RENDER_TO_MAINWINDOW 1004 #define IDC_REGISTERS 1005 #define IDC_ENABLEDEBUGGING 1006 #define IDC_TAB1 1007 diff --git a/Source/Plugins/Plugin_VideoDX9/Src/resource.rc b/Source/Plugins/Plugin_VideoDX9/Src/resource.rc index 89e99262a9..8a6a8b967e 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/resource.rc +++ b/Source/Plugins/Plugin_VideoDX9/Src/resource.rc @@ -91,7 +91,7 @@ BEGIN COMBOBOX IDC_RESOLUTIONWINDOWED,87,81,137,73,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP CONTROL "&Fullscreen",IDC_FULLSCREENENABLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,68,25,141,8 CONTROL "&V-Sync",IDC_VSYNC,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,68,38,141,8 - CONTROL "&Render in main window",IDC_RENDER_IN_MAINWINDOW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,68,50,141,8 + CONTROL "&Render to main window",IDC_RENDER_TO_MAINWINDOW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,68,50,141,8 END IDD_DEBUGGER DIALOGEX 0, 0, 234, 254 diff --git a/Source/Plugins/Plugin_VideoOGL/Src/GLInit.cpp b/Source/Plugins/Plugin_VideoOGL/Src/GLInit.cpp index 1310cebd9c..95c085a58f 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/GLInit.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/GLInit.cpp @@ -21,7 +21,6 @@ #endif #include "GLInit.h" - // Handles OpenGL and the window @@ -104,7 +103,7 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _width, int _height) #ifdef _WIN32 // create the window - if (g_VideoInitialize.pWindowHandle == NULL) { + if (!g_Config.renderToMainframe || g_VideoInitialize.pWindowHandle == NULL) { // create the window g_VideoInitialize.pWindowHandle = (void*)EmuWindow::Create(NULL, g_hInstance, "Please wait..."); if (g_VideoInitialize.pWindowHandle == NULL) { diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Globals.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Globals.cpp index 5e2ab90f23..49f5f9e6ef 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Globals.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Globals.cpp @@ -82,6 +82,7 @@ void Config::Load() iniFile.Get("Hardware", "WindowedRes", &iWindowedRes, 0); iniFile.Get("Hardware", "FullscreenRes", &iFSResolution, 0); iniFile.Get("Hardware", "Fullscreen", &bFullscreen, 0); + iniFile.Get("Hardware", "RenderToMainframe", &renderToMainframe, 0); if (iAdapter == -1) iAdapter = 0; @@ -112,6 +113,7 @@ void Config::Save() iniFile.Set("Hardware", "WindowedRes", iWindowedRes); iniFile.Set("Hardware", "FullscreenRes", iFSResolution); iniFile.Set("Hardware", "Fullscreen", bFullscreen); + iniFile.Set("Hardware", "RenderToMainframe", renderToMainframe); iniFile.Set("Settings", "OverlayStats", bOverlayStats); iniFile.Set("Settings", "OverlayStats", bOverlayStats); diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Globals.h b/Source/Plugins/Plugin_VideoOGL/Src/Globals.h index daf2f2794f..9576bb778f 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Globals.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/Globals.h @@ -164,6 +164,7 @@ struct Config int iPostprocessEffect; int iCompileDLsLevel; + bool renderToMainframe; int iLog; // CONF_ bits bool bFullscreen; bool bWireFrame; diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Windows/DlgSettings.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Windows/DlgSettings.cpp index b15be9f59a..ac433649d8 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Windows/DlgSettings.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Windows/DlgSettings.cpp @@ -48,6 +48,7 @@ struct TabOGL : public W32Util::Tab ComboBox_SetCurSel(GetDlgItem(hDlg,IDC_RESOLUTION), g_Config.iFSResolution); CheckDlgButton(hDlg, IDC_FULLSCREENENABLE, g_Config.bFullscreen ? TRUE : FALSE); + CheckDlgButton(hDlg, IDC_RENDER_TO_MAINWINDOW, g_Config.renderToMainframe ? TRUE : FALSE); } void Command(HWND hDlg,WPARAM wParam) @@ -67,6 +68,8 @@ struct TabOGL : public W32Util::Tab g_Config.iMultisampleMode = ComboBox_GetCurSel(GetDlgItem(hDlg, IDC_ANTIALIASMODE)); g_Config.iFSResolution = ComboBox_GetCurSel(GetDlgItem(hDlg,IDC_RESOLUTION)); g_Config.bFullscreen = Button_GetCheck(GetDlgItem(hDlg, IDC_FULLSCREENENABLE)) ? true : false; + g_Config.renderToMainframe = Button_GetCheck(GetDlgItem(hDlg, IDC_RENDER_TO_MAINWINDOW)) ? true : false; + g_Config.Save(); } }; diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Windows/resource.h b/Source/Plugins/Plugin_VideoOGL/Src/Windows/resource.h index b3068228bd..d4c66b6826 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Windows/resource.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/Windows/resource.h @@ -15,6 +15,7 @@ #define IDC_FULLSCREENENABLE 1002 #define IDC_LIST1 1003 #define IDC_DEBUGSTEP 1004 +#define IDC_RENDER_TO_MAINWINDOW 1004 #define IDC_REGISTERS 1005 #define IDC_ENABLEDEBUGGING 1006 #define IDC_TAB1 1007 diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Windows/resource.rc b/Source/Plugins/Plugin_VideoOGL/Src/Windows/resource.rc index 1304388e9a..0080df9f69 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Windows/resource.rc +++ b/Source/Plugins/Plugin_VideoOGL/Src/Windows/resource.rc @@ -78,13 +78,14 @@ IDD_SETTINGS DIALOGEX 0, 0, 231, 141 STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_SYSMENU FONT 8, "MS Shell Dlg", 0, 0, 0x0 BEGIN - LTEXT "&Fullscreen video mode:",IDC_STATIC,7,22,74,8 - LTEXT "&Antialias mode:",IDC_STATIC,7,60,61,8 - COMBOBOX IDC_ANTIALIASMODE,68,57,156,73,CBS_DROPDOWNLIST | WS_DISABLED | WS_VSCROLL | WS_TABSTOP - LTEXT "&Windowed resolution:",IDC_STATIC,7,41,74,8 - COMBOBOX IDC_RESOLUTIONWINDOWED,87,39,137,73,CBS_DROPDOWNLIST | WS_DISABLED | WS_VSCROLL | WS_TABSTOP + LTEXT "&Fullscreen video mode:",IDC_STATIC,7,39,74,8 + LTEXT "&Antialias mode:",IDC_STATIC,7,77,61,8 + COMBOBOX IDC_ANTIALIASMODE,68,74,156,73,CBS_DROPDOWNLIST | WS_DISABLED | WS_VSCROLL | WS_TABSTOP + LTEXT "&Windowed resolution:",IDC_STATIC,7,58,74,8 + COMBOBOX IDC_RESOLUTIONWINDOWED,87,56,137,73,CBS_DROPDOWNLIST | WS_DISABLED | WS_VSCROLL | WS_TABSTOP CONTROL "&Fullscreen",IDC_FULLSCREENENABLE,"Button",BS_AUTOCHECKBOX | WS_DISABLED | WS_TABSTOP,87,7,84,8 - COMBOBOX IDC_RESOLUTION,87,20,137,73,CBS_DROPDOWNLIST | WS_DISABLED | WS_VSCROLL | WS_TABSTOP + COMBOBOX IDC_RESOLUTION,87,37,137,73,CBS_DROPDOWNLIST | WS_DISABLED | WS_VSCROLL | WS_TABSTOP + CONTROL "&Render to main window",IDC_RENDER_TO_MAINWINDOW,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,87,20,103,8 END IDD_DEBUGGER DIALOGEX 0, 0, 234, 254