mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-25 07:09:48 -06:00
D3D: change window startup a bit (pretty minor but it's just to get me started :P)
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@4473 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -130,10 +130,11 @@ LRESULT CALLBACK WndProc( HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam )
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case WM_CLOSE:
|
case WM_CLOSE:
|
||||||
Fifo_ExitLoopNonBlocking();
|
//Fifo_ExitLoopNonBlocking();
|
||||||
Shutdown();
|
//Shutdown();
|
||||||
|
PostMessage( m_hParent, WM_USER, OPENGL_WM_USER_STOP, 0 );
|
||||||
// Simple hack to easily exit without stopping. Hope to fix the stopping errors soon.
|
// Simple hack to easily exit without stopping. Hope to fix the stopping errors soon.
|
||||||
ExitProcess(0);
|
//ExitProcess(0);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
case WM_DESTROY:
|
case WM_DESTROY:
|
||||||
@ -184,16 +185,16 @@ HWND OpenWindow(HWND parent, HINSTANCE hInstance, int width, int height, const T
|
|||||||
m_hInstance = hInstance;
|
m_hInstance = hInstance;
|
||||||
RegisterClassEx( &wndClass );
|
RegisterClassEx( &wndClass );
|
||||||
|
|
||||||
if (parent)
|
if (g_Config.RenderToMainframe)
|
||||||
{
|
{
|
||||||
m_hWnd = CreateWindow(m_szClassName, title,
|
|
||||||
WS_CHILD,
|
|
||||||
CW_USEDEFAULT, CW_USEDEFAULT,CW_USEDEFAULT, CW_USEDEFAULT,
|
|
||||||
parent, NULL, hInstance, NULL );
|
|
||||||
|
|
||||||
m_hParent = parent;
|
m_hParent = parent;
|
||||||
|
|
||||||
ShowWindow(m_hWnd, SW_SHOWMAXIMIZED);
|
m_hWnd = CreateWindowEx(0, m_szClassName, title, WS_CHILD,
|
||||||
|
0, 0, width, height,
|
||||||
|
m_hParent, NULL, hInstance, NULL);
|
||||||
|
|
||||||
|
if( !g_Config.bFullscreen )
|
||||||
|
SetWindowPos( GetParent(m_hParent), NULL, 0, 0, width, height, SWP_NOMOVE|SWP_NOZORDER );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -210,14 +211,9 @@ HWND OpenWindow(HWND parent, HINSTANCE hInstance, int width, int height, const T
|
|||||||
rc.top = (1024 - h)/2;
|
rc.top = (1024 - h)/2;
|
||||||
rc.bottom = rc.top + h;
|
rc.bottom = rc.top + h;
|
||||||
|
|
||||||
m_hWnd = CreateWindow(m_szClassName, title,
|
m_hWnd = CreateWindowEx(0, m_szClassName, title, style,
|
||||||
style,
|
|
||||||
rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top,
|
rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top,
|
||||||
parent, NULL, hInstance, NULL );
|
NULL, NULL, hInstance, NULL );
|
||||||
|
|
||||||
g_winstyle = GetWindowLong( m_hWnd, GWL_STYLE );
|
|
||||||
g_winstyle &= ~WS_MAXIMIZE & ~WS_MINIMIZE; // remove minimize/maximize style
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return m_hWnd;
|
return m_hWnd;
|
||||||
@ -225,14 +221,16 @@ HWND OpenWindow(HWND parent, HINSTANCE hInstance, int width, int height, const T
|
|||||||
|
|
||||||
void Show()
|
void Show()
|
||||||
{
|
{
|
||||||
ShowWindow(m_hWnd, SW_SHOW);
|
ShowWindow(m_hWnd, SW_SHOWNORMAL);
|
||||||
BringWindowToTop(m_hWnd);
|
BringWindowToTop(m_hWnd);
|
||||||
UpdateWindow(m_hWnd);
|
UpdateWindow(m_hWnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
HWND Create(HWND hParent, HINSTANCE hInstance, const TCHAR *title)
|
HWND Create(HWND hParent, HINSTANCE hInstance, const TCHAR *title)
|
||||||
{
|
{
|
||||||
return OpenWindow(hParent, hInstance, 640, 480, title);
|
int width=640, height=480;
|
||||||
|
sscanf( g_Config.bFullscreen ? g_Config.cFSResolution : g_Config.cInternalRes, "%dx%d", &width, &height );
|
||||||
|
return OpenWindow(hParent, hInstance, width, height, title);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Close()
|
void Close()
|
||||||
@ -244,7 +242,8 @@ void Close()
|
|||||||
void SetSize(int width, int height)
|
void SetSize(int width, int height)
|
||||||
{
|
{
|
||||||
RECT rc = {0, 0, width, height};
|
RECT rc = {0, 0, width, height};
|
||||||
AdjustWindowRect(&rc, WS_OVERLAPPEDWINDOW, false);
|
DWORD style = GetWindowLong(m_hWnd, GWL_STYLE);
|
||||||
|
AdjustWindowRect(&rc, style, false);
|
||||||
|
|
||||||
int w = rc.right - rc.left;
|
int w = rc.right - rc.left;
|
||||||
int h = rc.bottom - rc.top;
|
int h = rc.bottom - rc.top;
|
||||||
|
@ -118,13 +118,6 @@ bool Renderer::Init()
|
|||||||
{
|
{
|
||||||
UpdateActiveConfig();
|
UpdateActiveConfig();
|
||||||
int fullScreenRes, w_temp, h_temp;
|
int fullScreenRes, w_temp, h_temp;
|
||||||
sscanf(g_Config.cInternalRes, "%dx%d", &w_temp, &h_temp);
|
|
||||||
if (w_temp <= 0 || h_temp <= 0)
|
|
||||||
{
|
|
||||||
w_temp = 640;
|
|
||||||
h_temp = 480;
|
|
||||||
}
|
|
||||||
EmuWindow::SetSize(w_temp, h_temp);
|
|
||||||
s_blendMode = 0;
|
s_blendMode = 0;
|
||||||
int backbuffer_ms_mode = 0; // g_ActiveConfig.iMultisampleMode;
|
int backbuffer_ms_mode = 0; // g_ActiveConfig.iMultisampleMode;
|
||||||
|
|
||||||
|
@ -235,9 +235,9 @@ void Initialize(void *init)
|
|||||||
UpdateProjectionHack(g_Config.iPhackvalue); // DX9 projection hack could be disabled by commenting out this line
|
UpdateProjectionHack(g_Config.iPhackvalue); // DX9 projection hack could be disabled by commenting out this line
|
||||||
|
|
||||||
// create the window
|
// create the window
|
||||||
if (!g_Config.RenderToMainframe || 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, _T("Loading - Please wait."));
|
g_VideoInitialize.pWindowHandle = (void*)EmuWindow::Create(NULL, g_hInstance, _T("Loading - Please wait."));
|
||||||
else
|
else*/
|
||||||
g_VideoInitialize.pWindowHandle = (void*)EmuWindow::Create((HWND)g_VideoInitialize.pWindowHandle, g_hInstance, _T("Loading - Please wait."));
|
g_VideoInitialize.pWindowHandle = (void*)EmuWindow::Create((HWND)g_VideoInitialize.pWindowHandle, g_hInstance, _T("Loading - Please wait."));
|
||||||
if (g_VideoInitialize.pWindowHandle == NULL)
|
if (g_VideoInitialize.pWindowHandle == NULL)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user