mirror of
https://github.com/libretro/RetroArch
synced 2025-02-05 06:40:07 +00:00
(D3D) Use defines to hide away D3D version-specific types
This commit is contained in:
parent
88194bcdae
commit
772383effc
@ -34,6 +34,14 @@
|
|||||||
#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 D3DVIEWPORT D3DVIEWPORT9
|
||||||
|
|
||||||
class RenderChain;
|
class RenderChain;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
@ -48,8 +56,8 @@ typedef struct
|
|||||||
bool fullscreen;
|
bool fullscreen;
|
||||||
bool enabled;
|
bool enabled;
|
||||||
float alpha_mod;
|
float alpha_mod;
|
||||||
IDirect3DTexture9 *tex;
|
LPDIRECT3DTEXTURE tex;
|
||||||
IDirect3DVertexBuffer9 *vert_buf;
|
LPDIRECT3DVERTEXBUFFER vert_buf;
|
||||||
} overlay_t;
|
} overlay_t;
|
||||||
|
|
||||||
class D3DVideo
|
class D3DVideo
|
||||||
@ -105,8 +113,8 @@ class D3DVideo
|
|||||||
|
|
||||||
WNDCLASSEX windowClass;
|
WNDCLASSEX windowClass;
|
||||||
HWND hWnd;
|
HWND hWnd;
|
||||||
IDirect3D9 *g_pD3D;
|
LPDIRECT3D g_pD3D;
|
||||||
IDirect3DDevice9 *dev;
|
LPDIRECT3DDEVICE dev;
|
||||||
LPD3DXFONT font;
|
LPD3DXFONT font;
|
||||||
|
|
||||||
void recompute_pass_sizes();
|
void recompute_pass_sizes();
|
||||||
@ -115,7 +123,7 @@ class D3DVideo
|
|||||||
unsigned screen_width;
|
unsigned screen_width;
|
||||||
unsigned screen_height;
|
unsigned screen_height;
|
||||||
unsigned rotation;
|
unsigned rotation;
|
||||||
D3DVIEWPORT9 final_viewport;
|
D3DVIEWPORT final_viewport;
|
||||||
|
|
||||||
std::string cg_shader;
|
std::string cg_shader;
|
||||||
|
|
||||||
|
@ -343,8 +343,8 @@ bool D3DVideo::read_viewport(uint8_t *buffer)
|
|||||||
RARCH_PERFORMANCE_INIT(d3d_read_viewport);
|
RARCH_PERFORMANCE_INIT(d3d_read_viewport);
|
||||||
RARCH_PERFORMANCE_START(d3d_read_viewport);
|
RARCH_PERFORMANCE_START(d3d_read_viewport);
|
||||||
bool ret = true;
|
bool ret = true;
|
||||||
IDirect3DSurface9 *target = NULL;
|
LPDIRECT3DSURFACE target = NULL;
|
||||||
IDirect3DSurface9 *dest = NULL;
|
LPDIRECT3DSURFACE dest = NULL;
|
||||||
|
|
||||||
if (FAILED(Callback::d3d_err = dev->GetRenderTarget(0, &target)))
|
if (FAILED(Callback::d3d_err = dev->GetRenderTarget(0, &target)))
|
||||||
{
|
{
|
||||||
@ -916,14 +916,10 @@ bool D3DVideo::set_shader(const std::string &path)
|
|||||||
|
|
||||||
int D3DVideo::process_shader(void)
|
int D3DVideo::process_shader(void)
|
||||||
{
|
{
|
||||||
int ret = 0;
|
|
||||||
if (strcmp(path_get_extension(cg_shader.c_str()), "cgp") == 0)
|
if (strcmp(path_get_extension(cg_shader.c_str()), "cgp") == 0)
|
||||||
ret = init_multipass();
|
return init_multipass();
|
||||||
else
|
|
||||||
ret = init_singlepass();
|
|
||||||
|
|
||||||
if (ret)
|
return init_singlepass();
|
||||||
return ret;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void D3DVideo::recompute_pass_sizes(void)
|
void D3DVideo::recompute_pass_sizes(void)
|
||||||
@ -1229,7 +1225,7 @@ void D3DVideo::overlay_render(overlay_t &overlay)
|
|||||||
{0, 20, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0},
|
{0, 20, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0},
|
||||||
D3DDECL_END()
|
D3DDECL_END()
|
||||||
};
|
};
|
||||||
IDirect3DVertexDeclaration9 *vertex_decl;
|
LPDIRECT3DVERTEXDECLARATION vertex_decl;
|
||||||
dev->CreateVertexDeclaration(vElems, &vertex_decl);
|
dev->CreateVertexDeclaration(vElems, &vertex_decl);
|
||||||
dev->SetVertexDeclaration(vertex_decl);
|
dev->SetVertexDeclaration(vertex_decl);
|
||||||
vertex_decl->Release();
|
vertex_decl->Release();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user