2012-10-26 19:09:30 +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
|
2012-10-26 19:09:30 +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/>.
|
|
|
|
*/
|
|
|
|
|
2015-01-07 21:23:45 +00:00
|
|
|
#ifndef __D3DVIDEO_INTF_H__
|
|
|
|
#define __D3DVIDEO_INTF_H__
|
2012-10-26 19:09:30 +00:00
|
|
|
|
2016-01-09 02:06:18 +00:00
|
|
|
#include <string>
|
2014-10-24 22:12:23 +00:00
|
|
|
#include <vector>
|
|
|
|
|
2014-01-01 15:51:40 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "../../config.h"
|
|
|
|
#endif
|
|
|
|
|
2014-01-09 19:04:18 +00:00
|
|
|
#ifndef _XBOX
|
|
|
|
#define HAVE_WINDOW
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(_XBOX1)
|
|
|
|
#ifndef HAVE_D3D8
|
|
|
|
#define HAVE_D3D8
|
|
|
|
#endif
|
|
|
|
#else
|
|
|
|
#ifndef HAVE_D3D9
|
|
|
|
#define HAVE_D3D9
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
2015-11-17 07:20:10 +00:00
|
|
|
#include "../../defines/d3d_defines.h"
|
2015-04-26 14:46:56 +00:00
|
|
|
|
2014-09-11 18:59:52 +00:00
|
|
|
#ifdef _XBOX1
|
|
|
|
#include <xfont.h>
|
|
|
|
#endif
|
|
|
|
|
2012-10-26 19:09:30 +00:00
|
|
|
#include "../../driver.h"
|
2014-09-11 22:18:18 +00:00
|
|
|
|
|
|
|
#if defined(HAVE_CG) || defined(HAVE_GLSL) || defined(HAVE_HLSL)
|
2015-01-12 20:41:27 +00:00
|
|
|
#include "../video_shader_driver.h"
|
2014-09-11 22:18:18 +00:00
|
|
|
#endif
|
2012-10-26 19:09:30 +00:00
|
|
|
|
2015-04-03 18:36:19 +00:00
|
|
|
#include "../font_driver.h"
|
2015-01-12 20:53:04 +00:00
|
|
|
#include "../video_context_driver.h"
|
2015-11-18 12:00:13 +00:00
|
|
|
#include "../common/d3d_common.h"
|
2016-08-01 20:18:42 +00:00
|
|
|
#include "d3d_renderchains/render_chain_driver.h"
|
2015-11-17 10:09:32 +00:00
|
|
|
#ifdef _XBOX
|
|
|
|
#include "../../defines/xdk_defines.h"
|
|
|
|
#endif
|
2014-10-24 22:12:23 +00:00
|
|
|
|
2013-04-07 17:34:44 +00:00
|
|
|
typedef struct
|
|
|
|
{
|
2015-11-11 02:48:05 +00:00
|
|
|
float tex_coords[4];
|
|
|
|
float vert_coords[4];
|
2013-04-07 17:34:44 +00:00
|
|
|
unsigned tex_w, tex_h;
|
|
|
|
bool fullscreen;
|
2013-10-21 11:26:23 +00:00
|
|
|
bool enabled;
|
2013-04-07 17:34:44 +00:00
|
|
|
float alpha_mod;
|
2013-12-31 23:27:55 +00:00
|
|
|
LPDIRECT3DTEXTURE tex;
|
2015-11-17 22:53:35 +00:00
|
|
|
#ifdef HAVE_D3D9
|
2013-12-31 23:27:55 +00:00
|
|
|
LPDIRECT3DVERTEXBUFFER vert_buf;
|
2015-11-17 22:53:35 +00:00
|
|
|
#endif
|
2015-04-06 18:47:29 +00:00
|
|
|
} overlay_t;
|
2013-04-07 17:34:44 +00:00
|
|
|
|
2014-09-11 18:39:19 +00:00
|
|
|
#ifdef _XBOX
|
2014-09-11 18:31:37 +00:00
|
|
|
typedef struct Vertex
|
|
|
|
{
|
|
|
|
float x, y;
|
|
|
|
#if defined(_XBOX1)
|
|
|
|
float z;
|
|
|
|
float rhw;
|
|
|
|
#endif
|
|
|
|
float u, v;
|
|
|
|
} Vertex;
|
2014-09-11 18:39:19 +00:00
|
|
|
#endif
|
2014-09-11 18:31:37 +00:00
|
|
|
|
2014-03-07 18:34:17 +00:00
|
|
|
typedef struct d3d_video
|
2012-10-26 19:09:30 +00:00
|
|
|
{
|
2015-11-10 04:30:25 +00:00
|
|
|
bool keep_aspect;
|
2015-04-11 19:54:52 +00:00
|
|
|
bool should_resize;
|
|
|
|
bool quitting;
|
2012-10-26 19:09:30 +00:00
|
|
|
|
2015-11-09 23:30:00 +00:00
|
|
|
struct video_viewport vp;
|
2015-11-11 17:07:36 +00:00
|
|
|
WNDCLASSEX windowClass;
|
2015-04-11 19:54:52 +00:00
|
|
|
LPDIRECT3DDEVICE dev;
|
|
|
|
HRESULT d3d_err;
|
|
|
|
unsigned cur_mon_id;
|
|
|
|
unsigned dev_rotation;
|
|
|
|
D3DVIEWPORT final_viewport;
|
2012-10-26 19:09:30 +00:00
|
|
|
|
2016-01-09 02:06:18 +00:00
|
|
|
std::string shader_path;
|
2012-10-26 19:09:30 +00:00
|
|
|
|
2015-04-11 19:54:52 +00:00
|
|
|
struct video_shader shader;
|
|
|
|
video_info_t video_info;
|
2012-10-26 19:09:30 +00:00
|
|
|
|
2015-04-11 19:54:52 +00:00
|
|
|
bool needs_restore;
|
2012-10-26 19:09:30 +00:00
|
|
|
|
2015-04-11 19:54:52 +00:00
|
|
|
RECT font_rect;
|
|
|
|
RECT font_rect_shifted;
|
2012-10-26 19:09:30 +00:00
|
|
|
|
2013-03-27 14:55:59 +00:00
|
|
|
#ifdef HAVE_OVERLAY
|
2015-04-11 19:54:52 +00:00
|
|
|
bool overlays_enabled;
|
|
|
|
std::vector<overlay_t> overlays;
|
2013-04-07 17:34:44 +00:00
|
|
|
#endif
|
|
|
|
|
2015-04-06 18:47:29 +00:00
|
|
|
#if defined(HAVE_MENU)
|
2015-04-11 19:54:52 +00:00
|
|
|
overlay_t *menu;
|
2013-03-27 14:55:59 +00:00
|
|
|
#endif
|
2015-04-11 19:54:52 +00:00
|
|
|
const renderchain_driver_t *renderchain_driver;
|
|
|
|
void *renderchain_data;
|
2014-09-11 18:31:37 +00:00
|
|
|
|
2015-04-11 19:54:52 +00:00
|
|
|
/* TODO - refactor this away properly. */
|
|
|
|
bool resolution_hd_enable;
|
2014-03-07 18:34:17 +00:00
|
|
|
} d3d_video_t;
|
2012-10-26 19:09:30 +00:00
|
|
|
|
2015-04-11 19:56:38 +00:00
|
|
|
void d3d_make_d3dpp(void *data,
|
|
|
|
const video_info_t *info, D3DPRESENT_PARAMETERS *d3dpp);
|
|
|
|
|
2012-10-26 19:09:30 +00:00
|
|
|
#endif
|
|
|
|
|