mirror of
https://github.com/libretro/RetroArch
synced 2025-02-09 18:40:31 +00:00
(D3D) Split up version-agnostic defines into separate header file - will be
fleshed out later for D3D8, D3D9, etc.
This commit is contained in:
parent
4b0e56a52e
commit
115f706f24
@ -31,18 +31,10 @@
|
|||||||
#include <Cg/cg.h>
|
#include <Cg/cg.h>
|
||||||
#include <Cg/cgD3D9.h>
|
#include <Cg/cgD3D9.h>
|
||||||
#endif
|
#endif
|
||||||
|
#include "d3d_defines.h"
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
#define LPDIRECT3D LPDIRECT3D9
|
|
||||||
#define LPDIRECT3DDEVICE LPDIRECT3DDEVICE9
|
|
||||||
#define LPDIRECT3DTEXTURE LPDIRECT3DTEXTURE9
|
|
||||||
#define LPDIRECT3DVERTEXBUFFER LPDIRECT3DVERTEXBUFFER9
|
|
||||||
#define LPDIRECT3DSURFACE LPDIRECT3DSURFACE9
|
|
||||||
#define LPDIRECT3DVERTEXDECLARATION LPDIRECT3DVERTEXDECLARATION9
|
|
||||||
#define D3DVERTEXELEMENT D3DVERTEXELEMENT9
|
|
||||||
#define D3DVIEWPORT D3DVIEWPORT9
|
|
||||||
|
|
||||||
class RenderChain;
|
class RenderChain;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
|
31
gfx/d3d9/d3d_defines.h
Normal file
31
gfx/d3d9/d3d_defines.h
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
/* RetroArch - A frontend for libretro.
|
||||||
|
* Copyright (C) 2010-2013 - Hans-Kristian Arntzen
|
||||||
|
* Copyright (C) 2011-2013 - Daniel De Matteis
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License along with RetroArch.
|
||||||
|
* If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef D3DVIDEO_DEFINES_H
|
||||||
|
#define D3DVIDEO_DEFINES_H
|
||||||
|
|
||||||
|
#define LPDIRECT3D LPDIRECT3D9
|
||||||
|
#define LPDIRECT3DDEVICE LPDIRECT3DDEVICE9
|
||||||
|
#define LPDIRECT3DTEXTURE LPDIRECT3DTEXTURE9
|
||||||
|
#define LPDIRECT3DVERTEXBUFFER LPDIRECT3DVERTEXBUFFER9
|
||||||
|
#define LPDIRECT3DVERTEXSHADER LPDIRECT3DVERTEXSHADER9
|
||||||
|
#define LPDIRECT3DPIXELSHADER LPDIRECT3DPIXELSHADER9
|
||||||
|
#define LPDIRECT3DSURFACE LPDIRECT3DSURFACE9
|
||||||
|
#define LPDIRECT3DVERTEXDECLARATION LPDIRECT3DVERTEXDECLARATION9
|
||||||
|
#define D3DVERTEXELEMENT D3DVERTEXELEMENT9
|
||||||
|
#define D3DVIEWPORT D3DVIEWPORT9
|
||||||
|
|
||||||
|
#endif
|
@ -103,7 +103,7 @@ class RenderChain
|
|||||||
#endif
|
#endif
|
||||||
unsigned last_width, last_height;
|
unsigned last_width, last_height;
|
||||||
|
|
||||||
IDirect3DVertexDeclaration9 *vertex_decl;
|
LPDIRECT3DVERTEXDECLARATION vertex_decl;
|
||||||
std::vector<unsigned> attrib_map;
|
std::vector<unsigned> attrib_map;
|
||||||
};
|
};
|
||||||
std::vector<Pass> passes;
|
std::vector<Pass> passes;
|
||||||
|
@ -64,8 +64,8 @@ static const char *stock_hlsl_program =
|
|||||||
|
|
||||||
struct hlsl_program
|
struct hlsl_program
|
||||||
{
|
{
|
||||||
IDirect3DVertexShader9 *vprg;
|
LPDIRECT3DVERTEXSHADER vprg;
|
||||||
IDirect3DPixelShader9 *fprg;
|
LPDIRECT3DPIXELSHADER fprg;
|
||||||
D3DXHANDLE vid_size_f;
|
D3DXHANDLE vid_size_f;
|
||||||
D3DXHANDLE tex_size_f;
|
D3DXHANDLE tex_size_f;
|
||||||
D3DXHANDLE out_size_f;
|
D3DXHANDLE out_size_f;
|
||||||
@ -82,7 +82,7 @@ struct hlsl_program
|
|||||||
XMMATRIX mvp_val; /* TODO: Move to D3DXMATRIX here */
|
XMMATRIX mvp_val; /* TODO: Move to D3DXMATRIX here */
|
||||||
};
|
};
|
||||||
|
|
||||||
static IDirect3DDevice9 *d3d_device_ptr;
|
static LPDIRECT3DDEVICE d3d_device_ptr;
|
||||||
static struct hlsl_program prg[RARCH_HLSL_MAX_SHADERS] = {0};
|
static struct hlsl_program prg[RARCH_HLSL_MAX_SHADERS] = {0};
|
||||||
static bool hlsl_active = false;
|
static bool hlsl_active = false;
|
||||||
static unsigned active_index = 0;
|
static unsigned active_index = 0;
|
||||||
|
@ -63,9 +63,9 @@ typedef struct xdk_d3d_video
|
|||||||
LPDIRECT3DVERTEXBUFFER vertex_buf;
|
LPDIRECT3DVERTEXBUFFER vertex_buf;
|
||||||
LPDIRECT3DTEXTURE lpTexture;
|
LPDIRECT3DTEXTURE lpTexture;
|
||||||
#ifdef HAVE_D3D9
|
#ifdef HAVE_D3D9
|
||||||
D3DTexture lpTexture_ot_as16srgb;
|
LPDIRECT3DTEXTURE lpTexture_ot_as16srgb;
|
||||||
LPDIRECT3DTEXTURE lpTexture_ot;
|
LPDIRECT3DTEXTURE lpTexture_ot;
|
||||||
IDirect3DVertexDeclaration9* v_decl;
|
LPDIRECT3DVERTEXDECLARATION v_decl;
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_MENU
|
#ifdef HAVE_MENU
|
||||||
bool rgui_texture_enable;
|
bool rgui_texture_enable;
|
||||||
|
@ -34,7 +34,6 @@
|
|||||||
#define D3DVERTEXELEMENT D3DVERTEXELEMENT8
|
#define D3DVERTEXELEMENT D3DVERTEXELEMENT8
|
||||||
|
|
||||||
#define direct3d_create_ctx Direct3DCreate8
|
#define direct3d_create_ctx Direct3DCreate8
|
||||||
#define IDirect3DVertexBuffer IDirect3DVertexBuffer8
|
|
||||||
|
|
||||||
#define SetSamplerState_function(device, sampler, type, value) \
|
#define SetSamplerState_function(device, sampler, type, value) \
|
||||||
D3D__DirtyFlags |= (D3DDIRTYFLAG_TEXTURE_STATE_0 << sampler); \
|
D3D__DirtyFlags |= (D3DDIRTYFLAG_TEXTURE_STATE_0 << sampler); \
|
||||||
@ -77,7 +76,6 @@
|
|||||||
#define D3DVERTEXELEMENT D3DVERTEXELEMENT9
|
#define D3DVERTEXELEMENT D3DVERTEXELEMENT9
|
||||||
|
|
||||||
#define direct3d_create_ctx Direct3DCreate9
|
#define direct3d_create_ctx Direct3DCreate9
|
||||||
#define IDirect3DVertexDeclaration IDirect3DVertexDeclaration9
|
|
||||||
|
|
||||||
#define RD3DVertexBuffer_Lock(device, OffsetToLock, SizeToLock, ppbData, Flags) *ppbData = D3DVertexBuffer_Lock(device, OffsetToLock, SizeToLock, Flags)
|
#define RD3DVertexBuffer_Lock(device, OffsetToLock, SizeToLock, ppbData, Flags) *ppbData = D3DVertexBuffer_Lock(device, OffsetToLock, SizeToLock, Flags)
|
||||||
#define RD3DVertexBuffer_Unlock(device) D3DVertexBuffer_Unlock(device)
|
#define RD3DVertexBuffer_Unlock(device) D3DVertexBuffer_Unlock(device)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user