- const char *szShader =
- "struct VS_OUTPUT {\n"
- " float4 Pos : SV_POSITION;\n"
- " float4 Color : COLOR0;\n"
- "};\n"
- "\n"
- "VS_OUTPUT VS(float4 Pos : POSITION, float4 Color : COLOR) {\n"
- " VS_OUTPUT Out;\n"
- " Out.Pos = Pos;\n"
- " Out.Color = Color;\n"
- " return Out;\n"
- "}\n"
- "\n"
- "float4 PS(VS_OUTPUT In) : SV_Target {\n"
- " return In.Color;\n"
- "}\n"
- ;
-
- ID3D10Blob *pVertexShaderBlob = NULL;
- ID3D10Blob *pErrorMsgs = NULL;
-
- hr = D3D10CompileShader(szShader, strlen(szShader), NULL, NULL, NULL, "VS", "vs_4_0", 0, &pVertexShaderBlob, &pErrorMsgs);
- if (pErrorMsgs) {
- fprintf(stderr, "%s\n", pErrorMsgs->GetBufferPointer());
- pErrorMsgs->Release();
- }
+ ID3D10VertexShader * pVertexShader;
+ hr = g_pDevice->CreateVertexShader(g_VS, sizeof g_VS, &pVertexShader);