mirror of
https://github.com/libretro/RetroArch
synced 2025-04-09 21:45:45 +00:00
Expand win32_window_init
This commit is contained in:
parent
9205424ab4
commit
9207acd6f2
@ -247,24 +247,30 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
|
|||||||
return DefWindowProc(hwnd, message, wparam, lparam);
|
return DefWindowProc(hwnd, message, wparam, lparam);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool win32_window_init(WNDCLASSEX *wndclass, bool fullscreen)
|
bool win32_window_init(WNDCLASSEX *wndclass, bool fullscreen, const char *class_name)
|
||||||
{
|
{
|
||||||
#ifndef _XBOX
|
#ifndef _XBOX
|
||||||
wndclass->cbSize = sizeof(WNDCLASSEX);
|
wndclass->cbSize = sizeof(WNDCLASSEX);
|
||||||
wndclass->style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
|
wndclass->style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
|
||||||
wndclass->lpfnWndProc = WndProc;
|
|
||||||
wndclass->hInstance = GetModuleHandle(NULL);
|
wndclass->hInstance = GetModuleHandle(NULL);
|
||||||
wndclass->hCursor = LoadCursor(NULL, IDC_ARROW);
|
wndclass->hCursor = LoadCursor(NULL, IDC_ARROW);
|
||||||
wndclass->lpszClassName = "RetroArch";
|
wndclass->lpszClassName = (class_name == NULL) ? "RetroArch" : class_name;
|
||||||
wndclass->hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_ICON));
|
wndclass->hIcon = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(IDI_ICON));
|
||||||
wndclass->hIconSm = (HICON)LoadImage(GetModuleHandle(NULL),
|
wndclass->hIconSm = (HICON)LoadImage(GetModuleHandle(NULL),
|
||||||
MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, 16, 16, 0);
|
MAKEINTRESOURCE(IDI_ICON), IMAGE_ICON, 16, 16, 0);
|
||||||
if (!fullscreen)
|
if (!fullscreen)
|
||||||
wndclass->hbrBackground = (HBRUSH)COLOR_WINDOW;
|
wndclass->hbrBackground = (HBRUSH)COLOR_WINDOW;
|
||||||
|
|
||||||
|
if (class_name != NULL)
|
||||||
|
wndclass->lpfnWndProc = WndProc;
|
||||||
|
|
||||||
if (!RegisterClassEx(wndclass))
|
if (!RegisterClassEx(wndclass))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
/* TODO/FIXME - this is ugly. Find a better way */
|
||||||
|
if (class_name != NULL) /* this is non-NULL when we want a window for shader dialogs, abort here */
|
||||||
|
return true;
|
||||||
|
|
||||||
if (!win32_shader_dlg_init())
|
if (!win32_shader_dlg_init())
|
||||||
RARCH_ERR("[WGL]: wgl_shader_dlg_init() failed.\n");
|
RARCH_ERR("[WGL]: wgl_shader_dlg_init() failed.\n");
|
||||||
#endif
|
#endif
|
||||||
|
@ -61,7 +61,7 @@ bool win32_set_video_mode(void *data,
|
|||||||
bool win32_monitor_set_fullscreen(unsigned width,
|
bool win32_monitor_set_fullscreen(unsigned width,
|
||||||
unsigned height, unsigned refresh, char *dev_name);
|
unsigned height, unsigned refresh, char *dev_name);
|
||||||
|
|
||||||
bool win32_window_init(WNDCLASSEX *wndclass, bool fullscreen);
|
bool win32_window_init(WNDCLASSEX *wndclass, bool fullscreen, const char *class_name);
|
||||||
|
|
||||||
bool win32_window_create(void *data, unsigned style,
|
bool win32_window_create(void *data, unsigned style,
|
||||||
RECT *mon_rect, unsigned width,
|
RECT *mon_rect, unsigned width,
|
||||||
|
@ -575,7 +575,7 @@ static bool d3d_construct(d3d_video_t *d3d,
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
memset(&d3d->windowClass, 0, sizeof(d3d->windowClass));
|
memset(&d3d->windowClass, 0, sizeof(d3d->windowClass));
|
||||||
win32_window_init(&d3d->windowClass, true);
|
win32_window_init(&d3d->windowClass, true, NULL);
|
||||||
|
|
||||||
#ifdef HAVE_MONITOR
|
#ifdef HAVE_MONITOR
|
||||||
bool windowed_full;
|
bool windowed_full;
|
||||||
|
@ -310,7 +310,7 @@ static bool gfx_ctx_wgl_init(void *data)
|
|||||||
|
|
||||||
win32_window_reset();
|
win32_window_reset();
|
||||||
win32_monitor_init();
|
win32_monitor_init();
|
||||||
if (!win32_window_init(&wndclass, true))
|
if (!win32_window_init(&wndclass, true, NULL))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user