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