2013-12-09 14:22:46 +01:00
|
|
|
/* RetroArch - A frontend for libretro.
|
2014-01-01 01:50:59 +01:00
|
|
|
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
2017-01-22 13:40:32 +01:00
|
|
|
* Copyright (C) 2011-2017 - Daniel De Matteis
|
2016-12-02 23:36:23 -05:00
|
|
|
*
|
2013-12-09 14:22:46 +01:00
|
|
|
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
|
|
|
* of the GNU General Public License as published by the Free Software Found-
|
|
|
|
* ation, either version 3 of the License, or (at your option) any later version.
|
|
|
|
*
|
|
|
|
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE. See the GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef WIN32_COMMON_H__
|
|
|
|
#define WIN32_COMMON_H__
|
|
|
|
|
2015-04-09 05:19:29 +02:00
|
|
|
#include <string.h>
|
2015-11-11 17:41:20 +01:00
|
|
|
|
|
|
|
#ifndef _XBOX
|
|
|
|
#define WIN32_LEAN_AND_MEAN
|
|
|
|
#include <windows.h>
|
2017-09-03 23:39:25 -04:00
|
|
|
#if _WIN32_WINNT <= 0x0400
|
|
|
|
/* Windows versions below 98 do not support multiple monitors, so fake it */
|
|
|
|
#define COMPILE_MULTIMON_STUBS
|
|
|
|
#include <multimon.h>
|
|
|
|
#endif
|
|
|
|
|
2015-11-11 17:41:20 +01:00
|
|
|
#endif
|
|
|
|
|
2015-04-09 05:19:29 +02:00
|
|
|
#include <boolean.h>
|
2016-06-03 08:06:49 +02:00
|
|
|
#include <retro_common_api.h>
|
2015-04-09 05:19:29 +02:00
|
|
|
#include "../../driver.h"
|
2017-05-09 01:25:59 +02:00
|
|
|
#include "../video_driver.h"
|
2015-04-09 05:19:29 +02:00
|
|
|
|
2015-11-17 11:13:46 +01:00
|
|
|
#ifdef _XBOX
|
2015-11-17 11:11:41 +01:00
|
|
|
#include "../../defines/xdk_defines.h"
|
2017-08-09 13:39:14 +02:00
|
|
|
#else
|
2015-11-19 07:59:10 +01:00
|
|
|
#include "../../ui/drivers/ui_win32_resource.h"
|
2016-06-07 16:33:55 +02:00
|
|
|
#include "../../ui/drivers/ui_win32.h"
|
2017-08-09 13:39:14 +02:00
|
|
|
#endif
|
2013-12-09 14:22:46 +01:00
|
|
|
|
2017-08-09 13:39:14 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _XBOX
|
2015-11-11 18:26:10 +01:00
|
|
|
extern unsigned g_resize_width;
|
|
|
|
extern unsigned g_resize_height;
|
2015-11-12 05:17:21 +01:00
|
|
|
extern bool g_inited;
|
2015-11-12 05:14:09 +01:00
|
|
|
extern bool g_restore_desktop;
|
2016-06-04 06:02:15 +02:00
|
|
|
extern ui_window_win32_t main_window;
|
2015-11-11 18:26:10 +01:00
|
|
|
|
2015-11-11 17:36:52 +01:00
|
|
|
void win32_monitor_get_info(void);
|
|
|
|
|
2015-11-11 17:47:56 +01:00
|
|
|
void win32_monitor_info(void *data, void *hm_data, unsigned *mon_id);
|
2015-11-11 18:16:28 +01:00
|
|
|
|
2016-03-29 00:45:36 +02:00
|
|
|
void create_graphics_context(HWND hwnd, bool *quit);
|
2017-01-12 15:03:27 -05:00
|
|
|
|
2017-01-04 23:13:08 -05:00
|
|
|
void create_gdi_context(HWND hwnd, bool *quit);
|
2015-11-19 08:56:08 +01:00
|
|
|
|
2017-01-12 15:03:27 -05:00
|
|
|
bool gdi_has_menu_frame(void);
|
|
|
|
|
2015-11-19 08:56:08 +01:00
|
|
|
bool win32_shader_dlg_init(void);
|
|
|
|
void shader_dlg_show(HWND parent_hwnd);
|
|
|
|
void shader_dlg_params_reload(void);
|
2013-12-09 14:22:46 +01:00
|
|
|
#endif
|
|
|
|
|
2016-06-04 05:54:33 +02:00
|
|
|
void win32_monitor_from_window(void);
|
2015-11-17 10:49:36 +01:00
|
|
|
|
2015-11-12 01:22:28 +01:00
|
|
|
void win32_monitor_init(void);
|
|
|
|
|
2015-11-12 05:16:06 +01:00
|
|
|
bool win32_set_video_mode(void *data,
|
|
|
|
unsigned width, unsigned height,
|
2015-11-12 05:17:21 +01:00
|
|
|
bool fullscreen);
|
2015-11-12 05:16:06 +01:00
|
|
|
|
2015-11-19 08:37:25 +01:00
|
|
|
#ifndef _XBOX
|
2016-06-03 08:06:49 +02:00
|
|
|
RETRO_BEGIN_DECLS
|
2015-11-19 08:44:02 +01:00
|
|
|
|
|
|
|
bool win32_window_init(WNDCLASSEX *wndclass, bool fullscreen, const char *class_name);
|
|
|
|
|
2016-06-03 08:06:49 +02:00
|
|
|
RETRO_END_DECLS
|
2015-11-19 08:37:25 +01:00
|
|
|
#endif
|
2015-11-12 01:22:28 +01:00
|
|
|
|
2015-11-12 02:51:40 +01:00
|
|
|
bool win32_window_create(void *data, unsigned style,
|
|
|
|
RECT *mon_rect, unsigned width,
|
|
|
|
unsigned height, bool fullscreen);
|
|
|
|
|
2015-10-10 08:13:58 +02:00
|
|
|
bool win32_suppress_screensaver(void *data, bool enable);
|
|
|
|
|
2015-04-09 05:19:29 +02:00
|
|
|
bool win32_get_metrics(void *data,
|
2016-12-02 23:36:23 -05:00
|
|
|
enum display_metric_types type, float *value);
|
2015-04-09 05:19:29 +02:00
|
|
|
|
2015-04-10 09:30:18 +02:00
|
|
|
void win32_show_cursor(bool state);
|
|
|
|
|
2015-11-17 09:41:18 +01:00
|
|
|
HWND win32_get_window(void);
|
|
|
|
|
2015-11-17 09:02:02 +01:00
|
|
|
bool win32_has_focus(void);
|
2015-11-17 08:58:49 +01:00
|
|
|
|
2015-11-11 19:41:32 +01:00
|
|
|
void win32_check_window(bool *quit,
|
2015-11-11 19:48:24 +01:00
|
|
|
bool *resize, unsigned *width, unsigned *height);
|
2015-04-10 09:36:03 +02:00
|
|
|
|
2016-01-09 04:59:12 +01:00
|
|
|
void win32_set_window(unsigned *width, unsigned *height,
|
2016-01-09 05:00:56 +01:00
|
|
|
bool fullscreen, bool windowed_full, void *rect_data);
|
2016-01-09 04:59:12 +01:00
|
|
|
|
2016-12-02 00:59:01 +01:00
|
|
|
#ifndef _XBOX
|
2016-12-03 00:14:33 -05:00
|
|
|
void win32_set_style(MONITORINFOEX *current_mon, HMONITOR *hm_to_use,
|
2016-01-09 05:24:27 +01:00
|
|
|
unsigned *width, unsigned *height, bool fullscreen, bool windowed_full,
|
|
|
|
RECT *rect, RECT *mon_rect, DWORD *style);
|
2016-12-02 00:59:01 +01:00
|
|
|
#endif
|
2016-01-09 05:24:27 +01:00
|
|
|
|
2017-08-09 03:53:19 +02:00
|
|
|
void win32_get_video_output_size(
|
|
|
|
unsigned *width, unsigned *height);
|
|
|
|
|
|
|
|
void win32_get_video_output_prev(
|
2017-08-09 03:44:03 +02:00
|
|
|
unsigned *width, unsigned *height);
|
|
|
|
|
2017-08-09 04:09:44 +02:00
|
|
|
void win32_get_video_output_next(
|
|
|
|
unsigned *width, unsigned *height);
|
|
|
|
|
2015-11-17 10:16:16 +01:00
|
|
|
void win32_window_reset(void);
|
|
|
|
|
2015-11-17 09:44:26 +01:00
|
|
|
void win32_destroy_window(void);
|
|
|
|
|
2017-09-05 00:57:58 +02:00
|
|
|
#if defined(HAVE_D3D9) || defined(HAVE_D3D8)
|
2015-11-28 21:50:28 +01:00
|
|
|
LRESULT CALLBACK WndProcD3D(HWND hwnd, UINT message,
|
|
|
|
WPARAM wparam, LPARAM lparam);
|
2017-01-13 14:31:36 -05:00
|
|
|
#endif
|
2015-11-28 21:50:28 +01:00
|
|
|
|
2017-01-13 14:31:36 -05:00
|
|
|
#if defined(HAVE_OPENGL) || defined(HAVE_VULKAN)
|
2015-11-28 21:50:28 +01:00
|
|
|
LRESULT CALLBACK WndProcGL(HWND hwnd, UINT message,
|
|
|
|
WPARAM wparam, LPARAM lparam);
|
2017-01-13 14:31:36 -05:00
|
|
|
#endif
|
2015-11-28 21:50:28 +01:00
|
|
|
|
2017-01-04 22:57:00 -05:00
|
|
|
LRESULT CALLBACK WndProcGDI(HWND hwnd, UINT message,
|
|
|
|
WPARAM wparam, LPARAM lparam);
|
|
|
|
|
2015-11-17 10:49:36 +01:00
|
|
|
#ifdef _XBOX
|
|
|
|
BOOL IsIconic(HWND hwnd);
|
|
|
|
#endif
|
|
|
|
|
2017-08-09 13:39:14 +02:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2013-12-09 14:22:46 +01:00
|
|
|
#endif
|