RetroArch/xdk/xdk_d3d.h

91 lines
2.5 KiB
C
Raw Normal View History

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-04-21 21:13:50 +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.
*
2012-04-21 21:13:50 +00:00
* 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.
*
2012-04-21 21:31:57 +00:00
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _XDK_D3D_VIDEO_H
#define _XDK_D3D_VIDEO_H
#include <stdint.h>
#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"
#include "../gfx/gfx_context.h"
#include "../xdk/xdk_defines.h"
#define DFONT_MAX 4096
2014-03-06 03:58:21 +00:00
#if defined(_XBOX360)
#define D3DFVF_CUSTOMVERTEX 0
#elif defined(_XBOX1)
#define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZRHW | D3DFVF_TEX1)
2014-03-06 03:58:21 +00:00
#endif
typedef struct DrawVerticeFormats
{
2014-02-26 05:19:29 +00:00
float x, y;
#if defined(_XBOX1)
2014-02-26 05:19:29 +00:00
float z;
float rhw;
#endif
float u, v;
} DrawVerticeFormats;
typedef struct gl_shader_backend gl_shader_backend_t;
typedef struct d3d_video
{
const gfx_ctx_driver_t *ctx_driver;
const gl_shader_backend_t *shader;
2012-05-28 00:29:51 +00:00
bool should_resize;
bool quitting;
bool vsync;
unsigned last_width;
unsigned last_height;
unsigned screen_width;
unsigned screen_height;
2014-03-05 05:35:42 +00:00
unsigned dev_rotation;
unsigned tex_w, tex_h;
LPDIRECT3D g_pD3D;
LPDIRECT3DDEVICE dev;
LPDIRECT3DVERTEXBUFFER vertex_buf;
LPDIRECT3DTEXTURE lpTexture;
#ifdef HAVE_D3D9
LPDIRECT3DTEXTURE lpTexture_ot_as16srgb;
LPDIRECT3DTEXTURE lpTexture_ot;
LPDIRECT3DVERTEXDECLARATION v_decl;
2013-03-10 22:24:28 +00:00
#endif
#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;
#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;
D3DVIEWPORT final_viewport;
2012-11-20 01:51:00 +00:00
unsigned base_size;
LPDIRECT3DSURFACE lpSurface;
video_info_t video_info;
HRESULT d3d_err;
} d3d_video_t;
2014-03-05 21:10:36 +00:00
extern void d3d_make_d3dpp(void *data, const video_info_t *info, D3DPRESENT_PARAMETERS *d3dpp);
extern bool texture_image_render(struct texture_image *out_img);
#endif