2012-04-21 21:13:50 +00:00
|
|
|
/* RetroArch - A frontend for libretro.
|
2012-01-21 22:59:27 +00:00
|
|
|
* Copyright (C) 2010-2012 - Hans-Kristian Arntzen
|
|
|
|
* Copyright (C) 2011-2012 - Daniel De Matteis
|
|
|
|
*
|
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
|
|
|
|
|
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
|
2012-10-01 01:35:38 +00:00
|
|
|
#define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZRHW | D3DFVF_TEX1)
|
2012-04-09 14:04:24 +00:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
float x;
|
|
|
|
float y;
|
|
|
|
float z;
|
|
|
|
float rhw;
|
|
|
|
float u;
|
|
|
|
float v;
|
|
|
|
} primitive_t;
|
2012-02-12 00:34:48 +00:00
|
|
|
|
2012-03-08 12:44:20 +00:00
|
|
|
typedef struct DrawVerticeFormats
|
|
|
|
{
|
2012-10-01 01:35:38 +00:00
|
|
|
#if defined(_XBOX1)
|
|
|
|
float x, y, z;
|
|
|
|
float rhw;
|
|
|
|
#elif defined(_XBOX360)
|
2012-03-08 12:44:20 +00:00
|
|
|
float x, y;
|
2012-10-01 01:35:38 +00:00
|
|
|
#endif
|
2012-03-08 12:44:20 +00:00
|
|
|
float u, v;
|
|
|
|
} DrawVerticeFormats;
|
|
|
|
|
2012-07-07 17:15:06 +00:00
|
|
|
typedef struct xdk_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;
|
2012-04-09 14:04:24 +00:00
|
|
|
bool block_swap;
|
2012-10-01 01:35:38 +00:00
|
|
|
#ifdef HAVE_FBO
|
2012-11-19 03:46:48 +00:00
|
|
|
bool fbo_inited;
|
2012-10-01 01:35:38 +00:00
|
|
|
#endif
|
2012-05-28 00:29:51 +00:00
|
|
|
bool should_resize;
|
|
|
|
bool quitting;
|
|
|
|
bool vsync;
|
2012-04-09 14:04:24 +00:00
|
|
|
unsigned last_width;
|
|
|
|
unsigned last_height;
|
2012-11-20 05:39:35 +00:00
|
|
|
unsigned win_width;
|
|
|
|
unsigned win_height;
|
2012-11-19 18:56:53 +00:00
|
|
|
unsigned tex_w, tex_h;
|
2012-07-16 00:15:47 +00:00
|
|
|
LPDIRECT3D d3d_device;
|
|
|
|
LPDIRECT3DDEVICE d3d_render_device;
|
|
|
|
LPDIRECT3DVERTEXBUFFER vertex_buf;
|
|
|
|
LPDIRECT3DTEXTURE lpTexture;
|
2012-10-01 01:35:38 +00:00
|
|
|
#ifdef HAVE_D3D9
|
2012-05-06 16:53:43 +00:00
|
|
|
D3DTexture lpTexture_ot_as16srgb;
|
2012-07-16 00:15:47 +00:00
|
|
|
LPDIRECT3DTEXTURE lpTexture_ot;
|
2012-04-14 18:33:56 +00:00
|
|
|
IDirect3DVertexDeclaration9* v_decl;
|
2012-10-01 01:35:38 +00:00
|
|
|
#endif
|
|
|
|
#if defined(_XBOX1)
|
|
|
|
XFONT *debug_font;
|
|
|
|
D3DSurface *pBackBuffer, *pFrontBuffer;
|
|
|
|
#endif
|
2012-11-20 01:51:00 +00:00
|
|
|
D3DFORMAT internal_fmt;
|
|
|
|
D3DFORMAT texture_fmt;
|
|
|
|
unsigned base_size;
|
2012-07-16 00:15:47 +00:00
|
|
|
LPDIRECT3DSURFACE lpSurface;
|
2012-07-07 17:15:06 +00:00
|
|
|
} xdk_d3d_video_t;
|
2012-01-22 00:43:54 +00:00
|
|
|
|
2012-11-20 01:51:00 +00:00
|
|
|
extern void xdk_d3d_generate_pp(D3DPRESENT_PARAMETERS *d3dpp, const video_info_t *video);
|
2012-11-20 00:55:16 +00:00
|
|
|
|
2012-11-20 14:52:22 +00:00
|
|
|
#ifdef HAVE_FBO
|
|
|
|
extern void xdk_d3d_deinit_fbo(xdk_d3d_video_t *d3d);
|
|
|
|
extern void xdk_d3d_init_fbo(xdk_d3d_video_t *d3d);
|
|
|
|
#endif
|
|
|
|
|
2012-01-21 22:59:27 +00:00
|
|
|
#endif
|