2012-10-26 21:09:30 +02: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
|
2017-12-11 23:55:31 -08:00
|
|
|
*
|
2012-10-26 21:09:30 +02: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 22:23:45 +01:00
|
|
|
#ifndef __D3DVIDEO_INTF_H__
|
|
|
|
#define __D3DVIDEO_INTF_H__
|
2012-10-26 21:09:30 +02:00
|
|
|
|
2018-01-15 03:45:37 +01:00
|
|
|
#include <gfx/math/matrix_4x4.h>
|
|
|
|
|
2014-01-01 16:51:40 +01:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "../../config.h"
|
|
|
|
#endif
|
|
|
|
|
2014-01-09 20:04:18 +01:00
|
|
|
#ifndef _XBOX
|
|
|
|
#define HAVE_WINDOW
|
|
|
|
#endif
|
|
|
|
|
2015-11-17 08:20:10 +01:00
|
|
|
#include "../../defines/d3d_defines.h"
|
2015-04-26 16:46:56 +02:00
|
|
|
|
2014-09-11 20:59:52 +02:00
|
|
|
#ifdef _XBOX1
|
|
|
|
#include <xfont.h>
|
|
|
|
#endif
|
|
|
|
|
2012-10-26 21:09:30 +02:00
|
|
|
#include "../../driver.h"
|
2014-09-12 00:18:18 +02:00
|
|
|
|
2015-04-03 20:36:19 +02:00
|
|
|
#include "../font_driver.h"
|
2017-05-09 01:25:59 +02:00
|
|
|
#include "../video_driver.h"
|
2018-01-23 18:04:55 +01:00
|
|
|
#if defined(HAVE_D3D8) || defined(HAVE_D3D9)
|
2015-11-18 13:00:13 +01:00
|
|
|
#include "../common/d3d_common.h"
|
2018-01-23 18:04:55 +01:00
|
|
|
#endif
|
2015-11-17 11:09:32 +01:00
|
|
|
#ifdef _XBOX
|
|
|
|
#include "../../defines/xdk_defines.h"
|
|
|
|
#endif
|
2014-10-24 20:12:23 -02:00
|
|
|
|
2013-04-07 19:34:44 +02:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
bool fullscreen;
|
2013-10-21 13:26:23 +02:00
|
|
|
bool enabled;
|
2017-09-09 01:35:15 +02:00
|
|
|
unsigned tex_w, tex_h;
|
|
|
|
float tex_coords[4];
|
|
|
|
float vert_coords[4];
|
2013-04-07 19:34:44 +02:00
|
|
|
float alpha_mod;
|
2018-01-25 04:28:50 +01:00
|
|
|
void *tex;
|
2016-10-20 05:00:20 +02:00
|
|
|
void *vert_buf;
|
2015-04-06 20:47:29 +02:00
|
|
|
} overlay_t;
|
2013-04-07 19:34:44 +02:00
|
|
|
|
2014-09-11 20:31:37 +02:00
|
|
|
typedef struct Vertex
|
|
|
|
{
|
2018-01-17 07:10:45 +01:00
|
|
|
float x, y, z;
|
|
|
|
uint32_t color;
|
2014-09-11 20:31:37 +02:00
|
|
|
float u, v;
|
|
|
|
} Vertex;
|
|
|
|
|
2018-01-25 10:03:34 +01:00
|
|
|
typedef struct d3d_video_viewport
|
|
|
|
{
|
|
|
|
DWORD x;
|
|
|
|
DWORD y;
|
|
|
|
DWORD width;
|
|
|
|
DWORD height;
|
|
|
|
float min_z;
|
|
|
|
float max_z;
|
|
|
|
} d3d_video_viewport_t;
|
|
|
|
|
2014-03-07 19:34:17 +01:00
|
|
|
typedef struct d3d_video
|
2012-10-26 21:09:30 +02:00
|
|
|
{
|
2015-11-10 05:30:25 +01:00
|
|
|
bool keep_aspect;
|
2015-04-11 21:54:52 +02:00
|
|
|
bool should_resize;
|
|
|
|
bool quitting;
|
2017-09-09 01:35:15 +02:00
|
|
|
bool needs_restore;
|
|
|
|
#ifdef HAVE_OVERLAY
|
|
|
|
bool overlays_enabled;
|
|
|
|
#endif
|
|
|
|
/* TODO - refactor this away properly. */
|
|
|
|
bool resolution_hd_enable;
|
2012-10-26 21:09:30 +02:00
|
|
|
|
2015-04-11 21:54:52 +02:00
|
|
|
unsigned cur_mon_id;
|
|
|
|
unsigned dev_rotation;
|
2012-10-26 21:09:30 +02:00
|
|
|
|
2017-09-09 01:35:15 +02:00
|
|
|
overlay_t *menu;
|
|
|
|
const d3d_renderchain_driver_t *renderchain_driver;
|
|
|
|
void *renderchain_data;
|
2012-10-26 21:09:30 +02:00
|
|
|
|
2015-04-11 21:54:52 +02:00
|
|
|
RECT font_rect;
|
|
|
|
RECT font_rect_shifted;
|
2018-01-15 03:45:37 +01:00
|
|
|
math_matrix_4x4 mvp;
|
2018-01-24 22:50:44 +01:00
|
|
|
math_matrix_4x4 mvp_rotate;
|
2018-01-15 03:45:37 +01:00
|
|
|
math_matrix_4x4 mvp_transposed;
|
2012-10-26 21:09:30 +02:00
|
|
|
|
2017-09-09 01:35:15 +02:00
|
|
|
struct video_viewport vp;
|
|
|
|
struct video_shader shader;
|
|
|
|
video_info_t video_info;
|
|
|
|
WNDCLASSEX windowClass;
|
2018-01-25 01:45:03 +01:00
|
|
|
void *dev;
|
2018-01-25 10:03:34 +01:00
|
|
|
d3d_video_viewport_t final_viewport;
|
2017-09-09 01:35:15 +02:00
|
|
|
|
2017-10-02 01:38:06 +02:00
|
|
|
char *shader_path;
|
2017-09-09 01:35:15 +02:00
|
|
|
|
2018-01-14 02:21:48 +01:00
|
|
|
struct
|
|
|
|
{
|
|
|
|
int size;
|
|
|
|
int offset;
|
|
|
|
LPDIRECT3DVERTEXBUFFER buffer;
|
2018-01-15 21:44:34 +01:00
|
|
|
void *decl;
|
2018-01-14 02:21:48 +01:00
|
|
|
}menu_display;
|
|
|
|
|
2013-03-27 15:55:59 +01:00
|
|
|
#ifdef HAVE_OVERLAY
|
2017-10-02 06:12:33 +02:00
|
|
|
size_t overlays_size;
|
|
|
|
overlay_t *overlays;
|
2013-04-07 19:34:44 +02:00
|
|
|
#endif
|
2014-03-07 19:34:17 +01:00
|
|
|
} d3d_video_t;
|
2012-10-26 21:09:30 +02:00
|
|
|
|
2015-04-11 21:56:38 +02:00
|
|
|
void d3d_make_d3dpp(void *data,
|
|
|
|
const video_info_t *info, D3DPRESENT_PARAMETERS *d3dpp);
|
|
|
|
|
2012-10-26 21:09:30 +02:00
|
|
|
#endif
|
|
|
|
|