Create win32_window_create

This commit is contained in:
twinaphex 2015-11-12 02:51:40 +01:00
parent cb008b13f8
commit 0dce6479c1
4 changed files with 29 additions and 21 deletions

View File

@ -259,6 +259,28 @@ bool win32_window_init(WNDCLASSEX *wndclass, bool fullscreen)
return true;
}
bool win32_window_create(void *data, unsigned style,
RECT *mon_rect, unsigned width,
unsigned height, bool fullscreen)
{
#ifndef _XBOX
driver_t *driver = driver_get_ptr();
g_hwnd = CreateWindowEx(0, "RetroArch", "RetroArch",
style,
info->fullscreen ? mon_rect.left : g_pos_x,
info->fullscreen ? mon_rect.top : g_pos_y,
win_width, win_height,
NULL, NULL, NULL, data);
if (!g_hwnd)
return false;
driver->display_type = RARCH_DISPLAY_WIN32;
driver->video_display = 0;
driver->video_window = (uintptr_t)g_hwnd;
#endif
return true;
}
static bool win32_browser(
HWND owner,
char *filename,

View File

@ -58,6 +58,10 @@ void win32_monitor_init(void);
bool win32_window_init(WNDCLASSEX *wndclass, bool fullscreen);
bool win32_window_create(void *data, unsigned style,
RECT *mon_rect, unsigned width,
unsigned height, bool fullscreen);
bool win32_suppress_screensaver(void *data, bool enable);
bool win32_get_metrics(void *data,

View File

@ -667,16 +667,8 @@ static bool d3d_construct(d3d_video_t *d3d,
win_height = rect.bottom - rect.top;
}
g_hwnd = CreateWindowEx(0, "RetroArch", "RetroArch",
style,
info->fullscreen ? mon_rect.left : CW_USEDEFAULT,
info->fullscreen ? mon_rect.top : CW_USEDEFAULT,
win_width, win_height,
NULL, NULL, NULL, d3d);
driver->display_type = RARCH_DISPLAY_WIN32;
driver->video_display = 0;
driver->video_window = (uintptr_t)g_hwnd;
win32_window_create(d3d, style, &mon_rect, win_width,
win_height, info->fullscreen);
#endif
#endif

View File

@ -401,13 +401,7 @@ static bool gfx_ctx_wgl_set_video_mode(void *data,
g_resize_height = height = rect.bottom - rect.top;
}
g_hwnd = CreateWindowEx(0, "RetroArch", "RetroArch", style,
fullscreen ? mon_rect.left : g_pos_x,
fullscreen ? mon_rect.top : g_pos_y,
width, height,
NULL, NULL, NULL, NULL);
if (!g_hwnd)
if (!win32_window_create(NULL, style, &mon_rect, width, height, fullscreen))
goto error;
if (!fullscreen || windowed_full)
@ -443,10 +437,6 @@ static bool gfx_ctx_wgl_set_video_mode(void *data,
gfx_ctx_wgl_swap_interval(data, g_interval);
driver->display_type = RARCH_DISPLAY_WIN32;
driver->video_display = 0;
driver->video_window = (uintptr_t)g_hwnd;
return true;
error: