MSDN says you can compile your .hlsl files into byte arrays that are defined in header files. And this is the code they give.
#include "PixelShader.h"
ComPtr<ID3D11PixelShader> m_pPixelShader;
hr = pDevice->CreatePixelShader(g_psshader,
sizeof(g_psshader), nullptr, &m_pPixelShader);
So g_psshader
is the byte array. But how to define g_psshader?
There's nowhere I can find talk about that. I tried sereral way but all failed. MSDN provided a Media extensions sample. But there is no PixelShader.h in that sample.
In case you missed the question: How to define g_psshader in the code above(I mean in header PixelShader.h).