Remove EmuWindow.

All it did was raise complexity.
This commit is contained in:
Armada
2014-06-15 00:23:43 +02:00
parent 5a66ded081
commit f2759ffe65
14 changed files with 32 additions and 284 deletions

View File

@ -8,7 +8,6 @@
#include "DolphinWX/GLInterface/GLInterface.h"
#include "VideoCommon/EmuWindow.h"
#include "VideoCommon/RenderBase.h"
#include "VideoCommon/VertexShaderManager.h"
#include "VideoCommon/VideoConfig.h"
@ -59,13 +58,16 @@ bool cInterfaceWGL::PeekMessages()
// Show the current FPS
void cInterfaceWGL::UpdateFPSDisplay(const std::string& text)
{
EmuWindow::SetWindowText(text);
SetWindowTextA((HWND)m_window_handle, text.c_str());
}
// Create rendering window.
// Call browser: Core.cpp:EmuThread() > main.cpp:Video_Initialize()
bool cInterfaceWGL::Create(void *&window_handle)
{
if (window_handle == nullptr)
return false;
int _tx, _ty, _twidth, _theight;
Host_GetRenderWindowSize(_tx, _ty, _twidth, _theight);
@ -73,20 +75,12 @@ bool cInterfaceWGL::Create(void *&window_handle)
s_backbuffer_width = _twidth;
s_backbuffer_height = _theight;
m_window_handle = window_handle;
#ifdef _WIN32
dllHandle = LoadLibrary(TEXT("OpenGL32.dll"));
#endif
window_handle = (void*)EmuWindow::Create((HWND)window_handle, GetModuleHandle(0), _T("Please wait..."));
if (window_handle == nullptr)
{
Host_SysMessage("failed to create window");
return false;
}
// Show the window
EmuWindow::Show();
PIXELFORMATDESCRIPTOR pfd = // pfd Tells Windows How We Want Things To Be
{
sizeof(PIXELFORMATDESCRIPTOR), // Size Of This Pixel Format Descriptor
@ -111,7 +105,7 @@ bool cInterfaceWGL::Create(void *&window_handle)
int PixelFormat; // Holds The Results After Searching For A Match
if (!(hDC=GetDC(EmuWindow::GetWnd()))) {
if (!(hDC = GetDC((HWND)window_handle))) {
PanicAlert("(1) Can't create an OpenGL Device context. Fail.");
return false;
}
@ -151,15 +145,16 @@ bool cInterfaceWGL::ClearCurrent()
void cInterfaceWGL::Update()
{
RECT rcWindow;
if (!EmuWindow::GetParentWnd())
HWND parent = GetParent((HWND)m_window_handle);
if (!parent)
{
// We are not rendering to a child window - use client size.
GetClientRect(EmuWindow::GetWnd(), &rcWindow);
GetClientRect((HWND)m_window_handle, &rcWindow);
}
else
{
// We are rendering to a child window - use parent size.
GetWindowRect(EmuWindow::GetParentWnd(), &rcWindow);
GetWindowRect(parent, &rcWindow);
}
// Get the new window width and height
@ -168,11 +163,11 @@ void cInterfaceWGL::Update()
int height = rcWindow.bottom - rcWindow.top;
// If we are rendering to a child window
if (EmuWindow::GetParentWnd() != 0 &&
if (GetParent((HWND)m_window_handle) != 0 &&
(s_backbuffer_width != width || s_backbuffer_height != height) &&
width >= 4 && height >= 4)
{
::MoveWindow(EmuWindow::GetWnd(), 0, 0, width, height, FALSE);
::MoveWindow((HWND)m_window_handle, 0, 0, width, height, FALSE);
s_backbuffer_width = width;
s_backbuffer_height = height;
}
@ -192,7 +187,7 @@ void cInterfaceWGL::Shutdown()
hRC = nullptr;
}
if (hDC && !ReleaseDC(EmuWindow::GetWnd(), hDC))
if (hDC && !ReleaseDC((HWND)m_window_handle, hDC))
{
ERROR_LOG(VIDEO, "Attempt to release device context failed.");
hDC = nullptr;