mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
fix for fullscreen for both video plugins in windows
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@243 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
e0b3e32860
commit
e84721b13b
@ -2,6 +2,7 @@
|
|||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
|
||||||
#include "../../Core/Src/Core.h"
|
#include "../../Core/Src/Core.h"
|
||||||
|
#include "Globals.h"
|
||||||
#include "EmuWindow.h"
|
#include "EmuWindow.h"
|
||||||
|
|
||||||
namespace EmuWindow
|
namespace EmuWindow
|
||||||
@ -68,7 +69,7 @@ namespace EmuWindow
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
HWND OpenWindow(HWND parent, HINSTANCE hInstance, bool windowed, int width, int height, const TCHAR *title)
|
HWND OpenWindow(HWND parent, HINSTANCE hInstance, int width, int height, const TCHAR *title)
|
||||||
{
|
{
|
||||||
wndClass.cbSize = sizeof( wndClass );
|
wndClass.cbSize = sizeof( wndClass );
|
||||||
wndClass.style = CS_HREDRAW | CS_VREDRAW;
|
wndClass.style = CS_HREDRAW | CS_VREDRAW;
|
||||||
@ -86,7 +87,7 @@ namespace EmuWindow
|
|||||||
m_hInstance = hInstance;
|
m_hInstance = hInstance;
|
||||||
RegisterClassEx( &wndClass );
|
RegisterClassEx( &wndClass );
|
||||||
|
|
||||||
if (parent && windowed)
|
if (parent)
|
||||||
{
|
{
|
||||||
m_hWnd = CreateWindow(m_szClassName, title,
|
m_hWnd = CreateWindow(m_szClassName, title,
|
||||||
WS_CHILD,
|
WS_CHILD,
|
||||||
@ -99,7 +100,7 @@ namespace EmuWindow
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DWORD style = windowed ? WS_OVERLAPPEDWINDOW : WS_POPUP;
|
DWORD style = g_Config.bFullscreen ? WS_POPUP : WS_OVERLAPPEDWINDOW;
|
||||||
|
|
||||||
RECT rc = {0, 0, width, height};
|
RECT rc = {0, 0, width, height};
|
||||||
AdjustWindowRect(&rc, style, false);
|
AdjustWindowRect(&rc, style, false);
|
||||||
@ -135,7 +136,7 @@ namespace EmuWindow
|
|||||||
|
|
||||||
HWND Create(HWND hParent, HINSTANCE hInstance, const TCHAR *title)
|
HWND Create(HWND hParent, HINSTANCE hInstance, const TCHAR *title)
|
||||||
{
|
{
|
||||||
return OpenWindow(hParent, hInstance, true, 640, 480, title);
|
return OpenWindow(hParent, hInstance, 640, 480, title);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Close()
|
void Close()
|
||||||
|
@ -155,20 +155,22 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight
|
|||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
// create the window
|
// create the window
|
||||||
if (!g_Config.renderToMainframe || 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...");
|
g_VideoInitialize.pWindowHandle = (void*)EmuWindow::Create(NULL, g_hInstance, "Please wait...");
|
||||||
if (g_VideoInitialize.pWindowHandle == NULL) {
|
|
||||||
SysMessage("failed to create window");
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
EmuWindow::Show();
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
g_VideoInitialize.pWindowHandle = (void*)EmuWindow::Create((HWND)g_VideoInitialize.pWindowHandle, g_hInstance, "Please wait...");
|
g_VideoInitialize.pWindowHandle = (void*)EmuWindow::Create((HWND)g_VideoInitialize.pWindowHandle, g_hInstance, "Please wait...");
|
||||||
}
|
}
|
||||||
|
EmuWindow::Show();
|
||||||
|
|
||||||
|
if (g_VideoInitialize.pWindowHandle == NULL)
|
||||||
|
{
|
||||||
|
SysMessage("failed to create window");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
GLuint PixelFormat; // Holds The Results After Searching For A Match
|
GLuint PixelFormat; // Holds The Results After Searching For A Match
|
||||||
DWORD dwExStyle; // Window Extended Style
|
DWORD dwExStyle; // Window Extended Style
|
||||||
DWORD dwStyle; // Window Style
|
DWORD dwStyle; // Window Style
|
||||||
@ -197,17 +199,18 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
// change to default resolution
|
// change to default resolution
|
||||||
ChangeDisplaySettings(NULL, 0);
|
ChangeDisplaySettings(NULL, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (g_Config.bFullscreen) {
|
if (g_Config.bFullscreen && !g_Config.renderToMainframe)
|
||||||
dwExStyle=WS_EX_APPWINDOW;
|
{
|
||||||
dwStyle=WS_POPUP;
|
ShowCursor(FALSE);
|
||||||
//ShowCursor(FALSE);
|
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
|
{
|
||||||
dwExStyle=WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;
|
dwExStyle=WS_EX_APPWINDOW | WS_EX_WINDOWEDGE;
|
||||||
dwStyle=WS_OVERLAPPEDWINDOW;
|
dwStyle=WS_OVERLAPPEDWINDOW;
|
||||||
}
|
}
|
||||||
@ -391,7 +394,7 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight
|
|||||||
XMapRaised(GLWin.dpy, GLWin.win);
|
XMapRaised(GLWin.dpy, GLWin.win);
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
//SDL fo other OS (osx, bsd, ...)
|
//SDL for other OS (osx, bsd, ...)
|
||||||
int videoFlags = SDL_OPENGL;
|
int videoFlags = SDL_OPENGL;
|
||||||
SDL_Surface *screen;
|
SDL_Surface *screen;
|
||||||
const SDL_VideoInfo *videoInfo;
|
const SDL_VideoInfo *videoInfo;
|
||||||
@ -409,7 +412,7 @@ bool OpenGL_Create(SVideoInitialize &_VideoInitialize, int _iwidth, int _iheight
|
|||||||
SDL_Quit();
|
SDL_Quit();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//hw o sw ogl ?
|
//hw or sw ogl ?
|
||||||
if (videoInfo->hw_available)
|
if (videoInfo->hw_available)
|
||||||
videoFlags |= SDL_HWSURFACE;
|
videoFlags |= SDL_HWSURFACE;
|
||||||
else
|
else
|
||||||
|
@ -103,10 +103,9 @@ void ConfigDialog::CreateGUIControls()
|
|||||||
|
|
||||||
wxStaticText *AAText = new wxStaticText(m_PageVideo, ID_AATEXT, wxT("Anti-alias mode:"), wxDefaultPosition, wxDefaultSize, 0);
|
wxStaticText *AAText = new wxStaticText(m_PageVideo, ID_AATEXT, wxT("Anti-alias mode:"), wxDefaultPosition, wxDefaultSize, 0);
|
||||||
wxArrayString arrayStringFor_AliasModeCB;
|
wxArrayString arrayStringFor_AliasModeCB;
|
||||||
m_AliasModeCB = new wxComboBox(m_PageVideo, ID_ALIASMODECB, wxEmptyString, wxDefaultPosition, wxDefaultSize, arrayStringFor_AliasModeCB, wxCB_READONLY, wxDefaultValidator);
|
m_AliasModeCB = new wxComboBox(m_PageVideo, ID_ALIASMODECB, wxEmptyString, wxDefaultPosition, wxDefaultSize, arrayStringFor_AliasModeCB, 0, wxDefaultValidator);
|
||||||
wxString tmp;
|
wxString tmp;
|
||||||
tmp<<g_Config.iMultisampleMode;
|
tmp<<g_Config.iMultisampleMode;
|
||||||
// since wxCB_READONLY is being used, SetValue will only succeed if tmp is in the list.
|
|
||||||
m_AliasModeCB->SetValue(tmp);
|
m_AliasModeCB->SetValue(tmp);
|
||||||
|
|
||||||
//page2
|
//page2
|
||||||
|
@ -43,7 +43,6 @@ class ConfigDialog : public wxDialog
|
|||||||
public:
|
public:
|
||||||
ConfigDialog(wxWindow *parent, wxWindowID id = 1, const wxString &title = wxT("OpenGL Plugin Configuration"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = ConfigDialog_STYLE);
|
ConfigDialog(wxWindow *parent, wxWindowID id = 1, const wxString &title = wxT("OpenGL Plugin Configuration"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = ConfigDialog_STYLE);
|
||||||
virtual ~ConfigDialog();
|
virtual ~ConfigDialog();
|
||||||
void ConfigDialogActivate(wxActivateEvent& event);
|
|
||||||
void OKClick(wxCommandEvent& event);
|
void OKClick(wxCommandEvent& event);
|
||||||
void FullScreenCheck(wxCommandEvent& event);
|
void FullScreenCheck(wxCommandEvent& event);
|
||||||
void RenderMainCheck(wxCommandEvent& event);
|
void RenderMainCheck(wxCommandEvent& event);
|
||||||
|
@ -145,7 +145,6 @@ struct Config
|
|||||||
char texDumpPath[280];
|
char texDumpPath[280];
|
||||||
|
|
||||||
//currently unused:
|
//currently unused:
|
||||||
int aa; // anti-aliasing level
|
|
||||||
int iLog; // CONF_ bits
|
int iLog; // CONF_ bits
|
||||||
int iSaveTargetId;
|
int iSaveTargetId;
|
||||||
int iAdapter;
|
int iAdapter;
|
||||||
|
@ -135,7 +135,7 @@ namespace EmuWindow
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
HWND OpenWindow(HWND parent, HINSTANCE hInstance, bool windowed, int width, int height, const TCHAR *title)
|
HWND OpenWindow(HWND parent, HINSTANCE hInstance, int width, int height, const TCHAR *title)
|
||||||
{
|
{
|
||||||
wndClass.cbSize = sizeof( wndClass );
|
wndClass.cbSize = sizeof( wndClass );
|
||||||
wndClass.style = CS_HREDRAW | CS_VREDRAW;
|
wndClass.style = CS_HREDRAW | CS_VREDRAW;
|
||||||
@ -153,7 +153,7 @@ namespace EmuWindow
|
|||||||
m_hInstance = hInstance;
|
m_hInstance = hInstance;
|
||||||
RegisterClassEx( &wndClass );
|
RegisterClassEx( &wndClass );
|
||||||
|
|
||||||
if (parent && windowed)
|
if (parent)
|
||||||
{
|
{
|
||||||
m_hWnd = CreateWindow(m_szClassName, title,
|
m_hWnd = CreateWindow(m_szClassName, title,
|
||||||
WS_CHILD,
|
WS_CHILD,
|
||||||
@ -166,7 +166,7 @@ namespace EmuWindow
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
DWORD style = windowed ? WS_OVERLAPPEDWINDOW : WS_POPUP;
|
DWORD style = g_Config.bFullscreen ? WS_POPUP : WS_OVERLAPPEDWINDOW;
|
||||||
|
|
||||||
RECT rc = {0, 0, width, height};
|
RECT rc = {0, 0, width, height};
|
||||||
AdjustWindowRect(&rc, style, false);
|
AdjustWindowRect(&rc, style, false);
|
||||||
@ -202,7 +202,7 @@ namespace EmuWindow
|
|||||||
|
|
||||||
HWND Create(HWND hParent, HINSTANCE hInstance, const TCHAR *title)
|
HWND Create(HWND hParent, HINSTANCE hInstance, const TCHAR *title)
|
||||||
{
|
{
|
||||||
return OpenWindow(hParent, hInstance, true, 640, 480, title);
|
return OpenWindow(hParent, hInstance, 640, 480, title);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Close()
|
void Close()
|
||||||
|
@ -233,7 +233,7 @@ bool Renderer::Create2()
|
|||||||
|
|
||||||
s_pfont = new RasterFont();
|
s_pfont = new RasterFont();
|
||||||
|
|
||||||
SetAA(g_Config.aa);
|
SetAA(g_Config.iMultisampleMode);
|
||||||
GL_REPORT_ERROR();
|
GL_REPORT_ERROR();
|
||||||
|
|
||||||
// load the effect, find the best profiles (if any)
|
// load the effect, find the best profiles (if any)
|
||||||
|
Loading…
Reference in New Issue
Block a user