2012-04-21 21:13:50 +00:00
|
|
|
/* RetroArch - A frontend for libretro.
|
2014-01-01 00:50:59 +00:00
|
|
|
* Copyright (C) 2010-2014 - Hans-Kristian Arntzen
|
|
|
|
* Copyright (C) 2011-2014 - Daniel De Matteis
|
2012-01-21 22:59:27 +00:00
|
|
|
*
|
2012-04-21 21:13:50 +00:00
|
|
|
* RetroArch is free software: you can redistribute it and/or modify it under the terms
|
2012-01-21 22:59:27 +00:00
|
|
|
* 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.
|
|
|
|
*
|
2012-04-21 21:13:50 +00:00
|
|
|
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
2012-01-21 22:59:27 +00:00
|
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
* PURPOSE. See the GNU General Public License for more details.
|
|
|
|
*
|
2012-04-21 21:31:57 +00:00
|
|
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
2012-01-21 22:59:27 +00:00
|
|
|
* If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2012-10-01 01:35:38 +00:00
|
|
|
#ifndef _XDK_D3D_VIDEO_H
|
|
|
|
#define _XDK_D3D_VIDEO_H
|
2012-01-21 22:59:27 +00:00
|
|
|
|
2012-03-08 23:09:39 +00:00
|
|
|
#include <stdint.h>
|
2012-10-01 01:35:38 +00:00
|
|
|
#ifdef _XBOX1
|
|
|
|
#include <xfont.h>
|
|
|
|
#endif
|
2014-03-03 04:49:43 +00:00
|
|
|
#include "../gfx/shader_common.h"
|
|
|
|
#include "../gfx/shader_parse.h"
|
2014-05-28 19:14:11 +00:00
|
|
|
#include "../gfx/image/image.h"
|
2012-12-15 02:59:31 +00:00
|
|
|
#include "../gfx/fonts/d3d_font.h"
|
2012-10-01 01:35:38 +00:00
|
|
|
|
2012-09-30 22:09:04 +00:00
|
|
|
#include "../gfx/gfx_context.h"
|
2012-07-16 00:15:47 +00:00
|
|
|
#include "../xdk/xdk_defines.h"
|
2012-07-07 12:06:21 +00:00
|
|
|
|
2012-02-12 00:34:48 +00:00
|
|
|
#define DFONT_MAX 4096
|
2014-03-06 03:58:21 +00:00
|
|
|
#if defined(_XBOX360)
|
|
|
|
#define D3DFVF_CUSTOMVERTEX 0
|
|
|
|
#elif defined(_XBOX1)
|
2012-10-01 01:35:38 +00:00
|
|
|
#define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZRHW | D3DFVF_TEX1)
|
2014-03-06 03:58:21 +00:00
|
|
|
#endif
|
2012-04-09 14:04:24 +00:00
|
|
|
|
2012-03-08 12:44:20 +00:00
|
|
|
typedef struct DrawVerticeFormats
|
|
|
|
{
|
2014-02-26 05:19:29 +00:00
|
|
|
float x, y;
|
2012-10-01 01:35:38 +00:00
|
|
|
#if defined(_XBOX1)
|
2014-02-26 05:19:29 +00:00
|
|
|
float z;
|
2012-10-01 01:35:38 +00:00
|
|
|
float rhw;
|
|
|
|
#endif
|
2012-03-08 12:44:20 +00:00
|
|
|
float u, v;
|
|
|
|
} DrawVerticeFormats;
|
|
|
|
|
2013-04-12 19:56:43 +00:00
|
|
|
typedef struct gl_shader_backend gl_shader_backend_t;
|
|
|
|
|
2014-03-07 19:17:25 +00:00
|
|
|
typedef struct d3d_video
|
2012-01-22 00:43:54 +00:00
|
|
|
{
|
2012-11-19 03:09:16 +00:00
|
|
|
const gfx_ctx_driver_t *ctx_driver;
|
2013-04-12 19:56:43 +00:00
|
|
|
const gl_shader_backend_t *shader;
|
2012-05-28 00:29:51 +00:00
|
|
|
bool should_resize;
|
|
|
|
bool quitting;
|
|
|
|
bool vsync;
|
2014-05-29 02:30:32 +00:00
|
|
|
bool needs_restore;
|
2012-04-09 14:04:24 +00:00
|
|
|
unsigned last_width;
|
|
|
|
unsigned last_height;
|
2014-03-05 05:25:39 +00:00
|
|
|
unsigned screen_width;
|
|
|
|
unsigned screen_height;
|
2014-03-05 05:35:42 +00:00
|
|
|
unsigned dev_rotation;
|
2012-11-19 18:56:53 +00:00
|
|
|
unsigned tex_w, tex_h;
|
2014-03-05 05:11:39 +00:00
|
|
|
LPDIRECT3D g_pD3D;
|
2014-03-05 05:05:48 +00:00
|
|
|
LPDIRECT3DDEVICE dev;
|
2012-07-16 00:15:47 +00:00
|
|
|
LPDIRECT3DVERTEXBUFFER vertex_buf;
|
|
|
|
LPDIRECT3DTEXTURE lpTexture;
|
2012-10-01 01:35:38 +00:00
|
|
|
#ifdef HAVE_D3D9
|
2013-12-31 23:58:21 +00:00
|
|
|
LPDIRECT3DTEXTURE lpTexture_ot_as16srgb;
|
2012-07-16 00:15:47 +00:00
|
|
|
LPDIRECT3DTEXTURE lpTexture_ot;
|
2013-12-31 23:58:21 +00:00
|
|
|
LPDIRECT3DVERTEXDECLARATION v_decl;
|
2013-03-10 22:24:28 +00:00
|
|
|
#endif
|
2013-11-08 03:36:16 +00:00
|
|
|
#ifdef HAVE_MENU
|
2013-04-07 17:43:54 +00:00
|
|
|
bool rgui_texture_enable;
|
2013-04-13 15:00:46 +00:00
|
|
|
bool rgui_texture_full_screen;
|
2012-10-01 01:35:38 +00:00
|
|
|
#endif
|
2012-12-15 02:59:31 +00:00
|
|
|
const d3d_font_renderer_t *font_ctx;
|
2012-11-20 01:51:00 +00:00
|
|
|
D3DFORMAT internal_fmt;
|
|
|
|
D3DFORMAT texture_fmt;
|
2014-03-05 17:37:47 +00:00
|
|
|
D3DVIEWPORT final_viewport;
|
2012-11-20 01:51:00 +00:00
|
|
|
unsigned base_size;
|
2012-07-16 00:15:47 +00:00
|
|
|
LPDIRECT3DSURFACE lpSurface;
|
2014-03-03 00:45:01 +00:00
|
|
|
video_info_t video_info;
|
2014-03-07 04:31:24 +00:00
|
|
|
HRESULT d3d_err;
|
2014-03-07 19:17:25 +00:00
|
|
|
} d3d_video_t;
|
2012-01-22 00:43:54 +00:00
|
|
|
|
2014-03-05 21:10:36 +00:00
|
|
|
extern void d3d_make_d3dpp(void *data, const video_info_t *info, D3DPRESENT_PARAMETERS *d3dpp);
|
2013-04-10 08:06:15 +00:00
|
|
|
extern bool texture_image_render(struct texture_image *out_img);
|
2012-11-20 00:55:16 +00:00
|
|
|
|
2012-01-21 22:59:27 +00:00
|
|
|
#endif
|