Move win32_window_init

This commit is contained in:
twinaphex 2015-11-11 18:16:28 +01:00
parent 65a9419522
commit b40baa6323
3 changed files with 19 additions and 17 deletions

View File

@ -132,6 +132,23 @@ void win32_monitor_info(void *data, void *hm_data, unsigned *mon_id)
mon->cbSize = sizeof(MONITORINFOEX);
GetMonitorInfo(*hm_to_use, (MONITORINFO*)mon);
}
bool win32_window_init(WNDCLASSEX *wndclass)
{
wndclass->cbSize = sizeof(*wndclass);
wndclass->style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
wndclass->lpfnWndProc = WndProc;
wndclass->hInstance = GetModuleHandle(NULL);
wndclass->hCursor = LoadCursor(NULL, IDC_ARROW);
wndclass->lpszClassName = "RetroArch";
wndclass->hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_ICON));
wndclass->hIconSm = (HICON)LoadImage(GetModuleHandle(NULL),
MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, 16, 16, 0);
if (!RegisterClassEx(wndclass))
return false;
return true;
}
#endif
static bool win32_browser(

View File

@ -47,6 +47,8 @@ void win32_monitor_from_window(HWND data, bool destroy);
void win32_monitor_get_info(void);
void win32_monitor_info(void *data, void *hm_data, unsigned *mon_id);
bool win32_window_init(WNDCLASSEX *wndclass);
#endif
bool win32_suppress_screensaver(void *data, bool enable);

View File

@ -391,23 +391,6 @@ static void gfx_ctx_wgl_get_video_size(void *data, unsigned *width, unsigned *he
}
}
static bool win32_window_init(WNDCLASSEX *wndclass)
{
wndclass->cbSize = sizeof(*wndclass);
wndclass->style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
wndclass->lpfnWndProc = WndProc;
wndclass->hInstance = GetModuleHandle(NULL);
wndclass->hCursor = LoadCursor(NULL, IDC_ARROW);
wndclass->lpszClassName = "RetroArch";
wndclass->hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_ICON));
wndclass->hIconSm = (HICON)LoadImage(GetModuleHandle(NULL),
MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, 16, 16, 0);
if (!RegisterClassEx(wndclass))
return false;
return true;
}
static bool gfx_ctx_wgl_init(void *data)
{
WNDCLASSEX wndclass = {0};