2013-12-09 13:22:46 +00:00
|
|
|
/* RetroArch - A frontend for libretro.
|
2014-01-01 00:50:59 +00:00
|
|
|
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
2016-01-10 03:41:52 +00:00
|
|
|
* Copyright (C) 2011-2016 - Daniel De Matteis
|
2013-12-09 13:22:46 +00: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 03:19:29 +00:00
|
|
|
#include <string.h>
|
2015-11-11 16:41:20 +00:00
|
|
|
|
|
|
|
#ifndef _XBOX
|
|
|
|
#define WIN32_LEAN_AND_MEAN
|
|
|
|
#include <windows.h>
|
|
|
|
#endif
|
|
|
|
|
2015-04-09 03:19:29 +00:00
|
|
|
#include <boolean.h>
|
2016-06-03 06:06:49 +00:00
|
|
|
#include <retro_common_api.h>
|
2015-04-09 03:19:29 +00:00
|
|
|
#include "../../driver.h"
|
|
|
|
#include "../video_context_driver.h"
|
|
|
|
|
2015-11-17 10:13:46 +00:00
|
|
|
#ifdef _XBOX
|
2015-11-17 10:11:41 +00:00
|
|
|
#include "../../defines/xdk_defines.h"
|
2015-11-17 10:13:46 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef _XBOX
|
2015-11-19 06:59:10 +00:00
|
|
|
#include "../../ui/drivers/ui_win32_resource.h"
|
2016-06-07 14:33:55 +00:00
|
|
|
#include "../../ui/drivers/ui_win32.h"
|
2013-12-09 13:22:46 +00:00
|
|
|
|
2015-11-11 17:26:10 +00:00
|
|
|
extern unsigned g_resize_width;
|
|
|
|
extern unsigned g_resize_height;
|
2015-11-12 04:17:21 +00:00
|
|
|
extern bool g_inited;
|
2015-11-12 04:14:09 +00:00
|
|
|
extern bool g_restore_desktop;
|
2016-06-04 04:02:15 +00:00
|
|
|
extern ui_window_win32_t main_window;
|
2015-11-11 17:26:10 +00:00
|
|
|
|
2015-11-11 19:23:19 +00:00
|
|
|
LRESULT win32_handle_keyboard_event(HWND hwnd, UINT message,
|
2015-01-15 17:37:43 +00:00
|
|
|
WPARAM wparam, LPARAM lparam);
|
|
|
|
|
2015-11-11 16:36:52 +00:00
|
|
|
void win32_monitor_get_info(void);
|
|
|
|
|
2015-11-11 16:47:56 +00:00
|
|
|
void win32_monitor_info(void *data, void *hm_data, unsigned *mon_id);
|
2015-11-11 17:16:28 +00:00
|
|
|
|
2016-03-28 22:45:36 +00:00
|
|
|
void create_graphics_context(HWND hwnd, bool *quit);
|
2015-11-19 07:56:08 +00:00
|
|
|
|
|
|
|
bool win32_shader_dlg_init(void);
|
|
|
|
void shader_dlg_show(HWND parent_hwnd);
|
|
|
|
void shader_dlg_params_reload(void);
|
2013-12-09 13:22:46 +00:00
|
|
|
#endif
|
|
|
|
|
2016-06-04 03:54:33 +00:00
|
|
|
void win32_monitor_from_window(void);
|
2015-11-17 09:49:36 +00:00
|
|
|
|
2015-11-12 00:22:28 +00:00
|
|
|
void win32_monitor_init(void);
|
|
|
|
|
2015-11-12 04:16:06 +00:00
|
|
|
bool win32_set_video_mode(void *data,
|
|
|
|
unsigned width, unsigned height,
|
2015-11-12 04:17:21 +00:00
|
|
|
bool fullscreen);
|
2015-11-12 04:16:06 +00:00
|
|
|
|
2015-11-12 02:01:50 +00:00
|
|
|
bool win32_monitor_set_fullscreen(unsigned width,
|
|
|
|
unsigned height, unsigned refresh, char *dev_name);
|
|
|
|
|
2015-11-19 07:37:25 +00:00
|
|
|
#ifndef _XBOX
|
2016-06-03 06:06:49 +00:00
|
|
|
RETRO_BEGIN_DECLS
|
2015-11-19 07:44:02 +00:00
|
|
|
|
|
|
|
bool win32_window_init(WNDCLASSEX *wndclass, bool fullscreen, const char *class_name);
|
|
|
|
|
2016-06-03 06:06:49 +00:00
|
|
|
RETRO_END_DECLS
|
2015-11-19 07:37:25 +00:00
|
|
|
#endif
|
2015-11-12 00:22:28 +00:00
|
|
|
|
2015-11-12 01:51:40 +00:00
|
|
|
bool win32_window_create(void *data, unsigned style,
|
|
|
|
RECT *mon_rect, unsigned width,
|
|
|
|
unsigned height, bool fullscreen);
|
|
|
|
|
2015-10-10 06:13:58 +00:00
|
|
|
bool win32_suppress_screensaver(void *data, bool enable);
|
|
|
|
|
2015-04-09 03:19:29 +00:00
|
|
|
bool win32_get_metrics(void *data,
|
|
|
|
enum display_metric_types type, float *value);
|
|
|
|
|
2015-04-10 07:30:18 +00:00
|
|
|
void win32_show_cursor(bool state);
|
|
|
|
|
2015-11-17 08:41:18 +00:00
|
|
|
HWND win32_get_window(void);
|
|
|
|
|
2015-11-17 08:02:02 +00:00
|
|
|
bool win32_has_focus(void);
|
2015-11-17 07:58:49 +00:00
|
|
|
|
2015-11-11 18:41:32 +00:00
|
|
|
void win32_check_window(bool *quit,
|
2015-11-11 18:48:24 +00:00
|
|
|
bool *resize, unsigned *width, unsigned *height);
|
2015-04-10 07:36:03 +00:00
|
|
|
|
2016-01-09 03:59:12 +00:00
|
|
|
void win32_set_window(unsigned *width, unsigned *height,
|
2016-01-09 04:00:56 +00:00
|
|
|
bool fullscreen, bool windowed_full, void *rect_data);
|
2016-01-09 03:59:12 +00:00
|
|
|
|
2016-01-09 04:24:27 +00:00
|
|
|
void win32_set_style(MONITORINFOEX *current_mon, HMONITOR *hm_to_use,
|
|
|
|
unsigned *width, unsigned *height, bool fullscreen, bool windowed_full,
|
|
|
|
RECT *rect, RECT *mon_rect, DWORD *style);
|
|
|
|
|
2015-11-17 09:16:16 +00:00
|
|
|
void win32_window_reset(void);
|
|
|
|
|
2015-11-17 08:44:26 +00:00
|
|
|
void win32_destroy_window(void);
|
|
|
|
|
2015-11-28 20:50:28 +00:00
|
|
|
LRESULT CALLBACK WndProcD3D(HWND hwnd, UINT message,
|
|
|
|
WPARAM wparam, LPARAM lparam);
|
|
|
|
|
|
|
|
LRESULT CALLBACK WndProcGL(HWND hwnd, UINT message,
|
|
|
|
WPARAM wparam, LPARAM lparam);
|
|
|
|
|
2015-11-17 09:49:36 +00:00
|
|
|
#ifdef _XBOX
|
|
|
|
BOOL IsIconic(HWND hwnd);
|
|
|
|
#endif
|
|
|
|
|
2013-12-09 13:22:46 +00:00
|
|
|
#endif
|