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
This commit is contained in:
fires.gc 2008-07-17 10:17:19 +00:00
parent b503d023bc
commit ceb924f398
12 changed files with 23 additions and 17 deletions

View File

@ -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();
}
};

View File

@ -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);

View File

@ -16,7 +16,7 @@ struct Config
int iPostprocessEffect;
int iCompileDLsLevel;
bool renderInMainframe;
bool renderToMainframe;
bool bFullscreen;
bool bVsync;
bool bWireFrame;

View File

@ -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...");
}

View File

@ -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

View File

@ -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

View File

@ -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) {

View File

@ -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);

View File

@ -164,6 +164,7 @@ struct Config
int iPostprocessEffect;
int iCompileDLsLevel;
bool renderToMainframe;
int iLog; // CONF_ bits
bool bFullscreen;
bool bWireFrame;

View File

@ -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();
}
};

View File

@ -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

View File

@ -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