mirror of
https://github.com/libretro/RetroArch
synced 2025-04-01 04:20:27 +00:00
(D3D) Add HAVE_CG/_XBOX ifdefs
This commit is contained in:
parent
8783eb69e6
commit
185dc3731f
@ -123,19 +123,23 @@ void d3d_recompute_pass_sizes(void *data)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_CG
|
|
||||||
bool d3d_init_shader(void *data)
|
bool d3d_init_shader(void *data)
|
||||||
{
|
{
|
||||||
D3DVideo *d3d = reinterpret_cast<D3DVideo*>(data);
|
D3DVideo *d3d = reinterpret_cast<D3DVideo*>(data);
|
||||||
|
(void)d3d;
|
||||||
|
#ifdef HAVE_CG
|
||||||
d3d->cgCtx = cgCreateContext();
|
d3d->cgCtx = cgCreateContext();
|
||||||
if (d3d->cgCtx == NULL)
|
if (d3d->cgCtx == NULL)
|
||||||
return false;
|
return false;
|
||||||
|
#endif
|
||||||
|
|
||||||
RARCH_LOG("[D3D9 Cg]: Created context.\n");
|
RARCH_LOG("[D3D]: Created shader context.\n");
|
||||||
|
|
||||||
|
#ifdef HAVE_CG
|
||||||
HRESULT ret = cgD3D9SetDevice(d3d->dev);
|
HRESULT ret = cgD3D9SetDevice(d3d->dev);
|
||||||
if (FAILED(ret))
|
if (FAILED(ret))
|
||||||
return false;
|
return false;
|
||||||
|
#endif
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -143,6 +147,8 @@ bool d3d_init_shader(void *data)
|
|||||||
void d3d_deinit_shader(void *data)
|
void d3d_deinit_shader(void *data)
|
||||||
{
|
{
|
||||||
D3DVideo *d3d = reinterpret_cast<D3DVideo*>(data);
|
D3DVideo *d3d = reinterpret_cast<D3DVideo*>(data);
|
||||||
|
(void)d3d;
|
||||||
|
#ifdef HAVE_CG
|
||||||
if (!d3d->cgCtx)
|
if (!d3d->cgCtx)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -150,6 +156,7 @@ void d3d_deinit_shader(void *data)
|
|||||||
cgD3D9SetDevice(NULL);
|
cgD3D9SetDevice(NULL);
|
||||||
cgDestroyContext(d3d->cgCtx);
|
cgDestroyContext(d3d->cgCtx);
|
||||||
d3d->cgCtx = NULL;
|
d3d->cgCtx = NULL;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
bool d3d_init_singlepass(void *data)
|
bool d3d_init_singlepass(void *data)
|
||||||
@ -165,7 +172,6 @@ bool d3d_init_singlepass(void *data)
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
bool d3d_init_imports(void *data)
|
bool d3d_init_imports(void *data)
|
||||||
{
|
{
|
||||||
@ -440,6 +446,7 @@ void d3d_make_d3dpp(void *data, const video_info_t *info, D3DPRESENT_PARAMETERS
|
|||||||
bool d3d_alive_func(void *data)
|
bool d3d_alive_func(void *data)
|
||||||
{
|
{
|
||||||
D3DVideo *d3d = reinterpret_cast<D3DVideo*>(data);
|
D3DVideo *d3d = reinterpret_cast<D3DVideo*>(data);
|
||||||
|
#ifndef _XBOX
|
||||||
MSG msg;
|
MSG msg;
|
||||||
|
|
||||||
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
|
while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
|
||||||
@ -447,5 +454,6 @@ bool d3d_alive_func(void *data)
|
|||||||
TranslateMessage(&msg);
|
TranslateMessage(&msg);
|
||||||
DispatchMessage(&msg);
|
DispatchMessage(&msg);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user