use D3D10CreateEffectFromMemory
This commit is contained in:
parent
98804d9ee4
commit
8833c106a8
37
main.cpp
37
main.cpp
@ -245,28 +245,23 @@ HRESULT InitDirect3DDevice()
|
|||||||
|
|
||||||
// effect
|
// effect
|
||||||
|
|
||||||
ID3D10Blob * pBlobErrors = NULL;
|
HRSRC hRes = FindResource(NULL, L"RES_MAIN_FXO", RT_RCDATA);
|
||||||
DWORD dwShaderFlags = D3D10_SHADER_ENABLE_STRICTNESS | D3D10_SHADER_DEBUG;
|
if (hRes == NULL) {
|
||||||
hr = D3DX10CreateEffectFromResource(NULL,
|
print("FindResource\n");
|
||||||
L"RES_MAIN_FXO",
|
return -1;
|
||||||
L"main.fxo",
|
}
|
||||||
NULL,
|
DWORD dwResSize = SizeofResource(NULL, hRes);
|
||||||
NULL,
|
HGLOBAL hData = LoadResource(NULL, hRes);
|
||||||
"fx_4_0",
|
void * pData = LockResource(hData);
|
||||||
dwShaderFlags,
|
hr = D3D10CreateEffectFromMemory(pData,
|
||||||
0,
|
dwResSize,
|
||||||
g_pd3dDevice,
|
0,
|
||||||
NULL,
|
g_pd3dDevice,
|
||||||
NULL,
|
NULL,
|
||||||
&g_pEffect,
|
&g_pEffect
|
||||||
&pBlobErrors,
|
);
|
||||||
NULL);
|
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
print("D3DX10CreateEffectFromResource\n");
|
print("D3D10CreateEffectFromMemory\n");
|
||||||
if (pBlobErrors != NULL) {
|
|
||||||
const char * pError = (const char *)pBlobErrors->GetBufferPointer();
|
|
||||||
print("pError: %p\n", pError);
|
|
||||||
}
|
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user