Take out windowClass from D3D struct

This commit is contained in:
twinaphex 2015-11-11 18:03:51 +01:00
parent 00cbf68e95
commit 6e689ec0f0
2 changed files with 14 additions and 15 deletions

View File

@ -577,6 +577,9 @@ static bool d3d_construct(d3d_video_t *d3d,
void **input_data)
{
unsigned full_x, full_y;
#ifdef HAVE_WINDOW
WNDCLASSEX wndclass = {0};
#endif
driver_t *driver = driver_get_ptr();
settings_t *settings = config_get_ptr();
@ -602,22 +605,21 @@ static bool d3d_construct(d3d_video_t *d3d,
#endif
#if defined(HAVE_WINDOW) && !defined(_XBOX)
memset(&d3d->windowClass, 0, sizeof(d3d->windowClass));
d3d->windowClass.cbSize = sizeof(d3d->windowClass);
d3d->windowClass.style = CS_HREDRAW | CS_VREDRAW;
d3d->windowClass.lpfnWndProc = WindowProc;
d3d->windowClass.hInstance = NULL;
d3d->windowClass.hCursor = LoadCursor(NULL, IDC_ARROW);
d3d->windowClass.lpszClassName = "RetroArch";
d3d->windowClass.hIcon = LoadIcon(GetModuleHandle(NULL),
wndclass.cbSize = sizeof(wndclass);
wndclass.style = CS_HREDRAW | CS_VREDRAW;
wndclass.lpfnWndProc = WindowProc;
wndclass.hInstance = NULL;
wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
wndclass.lpszClassName = "RetroArch";
wndclass.hIcon = LoadIcon(GetModuleHandle(NULL),
MAKEINTRESOURCE(IDI_ICON));
d3d->windowClass.hIconSm = (HICON)LoadImage(GetModuleHandle(NULL),
wndclass.hIconSm = (HICON)LoadImage(GetModuleHandle(NULL),
MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, 16, 16, 0);
if (!info->fullscreen)
d3d->windowClass.hbrBackground = (HBRUSH)COLOR_WINDOW;
wndclass.hbrBackground = (HBRUSH)COLOR_WINDOW;
RegisterClassEx(&d3d->windowClass);
if (!RegisterClassEx(&wndclass))
return false;
#endif
#ifdef HAVE_MONITOR

View File

@ -98,9 +98,6 @@ typedef struct d3d_video
bool quitting;
struct video_viewport vp;
#ifdef HAVE_WINDOW
WNDCLASSEX windowClass;
#endif
HWND hWnd;
LPDIRECT3D g_pD3D;
LPDIRECT3DDEVICE dev;