(XDK) Changes to bring inline with PC D3D

This commit is contained in:
twinaphex 2014-06-07 05:33:42 +02:00
parent 7ab54fd734
commit 8b9fc04f2e
3 changed files with 48 additions and 1 deletions

View File

@ -1433,7 +1433,9 @@ static void *d3d_init(const video_info_t *info, const input_driver_t **input,
//default values
vid->g_pD3D = NULL;
vid->dev = NULL;
#ifndef _XBOX
vid->font = NULL;
#endif
vid->dev_rotation = 0;
vid->needs_restore = false;
#ifdef HAVE_CG

View File

@ -1093,6 +1093,21 @@ static bool d3d_construct(void *data, const video_info_t *info, const input_driv
gfx_set_dwm();
#endif
#ifdef HAVE_MENU
if (d3d->rgui)
free(d3d->rgui);
d3d->rgui = (overlay_t*)calloc(1, sizeof(overlay_t));
d3d->rgui->tex_coords.x = 0;
d3d->rgui->tex_coords.y = 0;
d3d->rgui->tex_coords.w = 1;
d3d->rgui->tex_coords.h = 1;
d3d->rgui->vert_coords.x = 0;
d3d->rgui->vert_coords.y = 1;
d3d->rgui->vert_coords.w = 1;
d3d->rgui->vert_coords.h = -1;
#endif
#ifdef HAVE_WINDOW
memset(&d3d->windowClass, 0, sizeof(d3d->windowClass));
d3d->windowClass.cbSize = sizeof(d3d->windowClass);
@ -1233,13 +1248,20 @@ static void *d3d_init(const video_info_t *info, const input_driver_t **input, vo
//default values
vid->g_pD3D = NULL;
vid->dev = NULL;
#ifndef _XBOX
vid->font = NULL;
#endif
vid->dev_rotation = 0;
vid->needs_restore = false;
#ifdef HAVE_CG
vid->cgCtx = NULL;
#endif
#ifdef HAVE_OVERLAY
vid->overlays_enabled = false;
#endif
vid->should_resize = false;
vid->vsync = info->vsync;
vid->rgui = NULL;
if (!d3d_construct(vid, info, input, input_data))
{

View File

@ -36,6 +36,22 @@
#define D3DFVF_CUSTOMVERTEX (D3DFVF_XYZRHW | D3DFVF_TEX1)
#endif
typedef struct
{
struct Coords
{
float x, y, w, h;
};
Coords tex_coords;
Coords vert_coords;
unsigned tex_w, tex_h;
bool fullscreen;
bool enabled;
float alpha_mod;
LPDIRECT3DTEXTURE tex;
LPDIRECT3DVERTEXBUFFER vert_buf;
} overlay_t;
typedef struct DrawVerticeFormats
{
float x, y;
@ -50,6 +66,7 @@ typedef struct gl_shader_backend gl_shader_backend_t;
typedef struct d3d_video
{
const d3d_font_renderer_t *font_ctx;
const gfx_ctx_driver_t *ctx_driver;
const gl_shader_backend_t *shader;
bool should_resize;
@ -63,6 +80,9 @@ typedef struct d3d_video
HWND hWnd;
LPDIRECT3D g_pD3D;
LPDIRECT3DDEVICE dev;
#ifndef _XBOX
LPD3DXFONT font;
#endif
#ifdef HAVE_D3D9
LPDIRECT3DSURFACE lpSurface;
LPDIRECT3DTEXTURE lpTexture_ot_as16srgb;
@ -72,7 +92,6 @@ typedef struct d3d_video
bool rgui_texture_enable;
bool rgui_texture_full_screen;
#endif
const d3d_font_renderer_t *font_ctx;
D3DVIEWPORT final_viewport;
video_info_t video_info;
HRESULT d3d_err;
@ -90,6 +109,10 @@ typedef struct d3d_video
// RENDERCHAIN PASS -> INFO
unsigned tex_w;
unsigned tex_h;
#ifdef HAVE_MENU
overlay_t *rgui;
#endif
} d3d_video_t;
extern void d3d_make_d3dpp(void *data, const video_info_t *info, D3DPRESENT_PARAMETERS *d3dpp);